Archiving an object in Dot Net and unarchiving in Cocoa - cocoa

I have a web service which is written in DotNet and returns a archived class object which I need to unarchive in a Cocoa app.
Is this possible?
I tried to use the information in How to encode/decode a long long property with NSCoder?, but I don't know the key to decode it, and my attempts caused a crash.
Should I be using NSCoder, or something else?

I would serialize and deserialze in a well known interchange format, like YAML, XML(XML::RPC, SOAP) or JSON, I would probably go with JSON. if you are on iOS and able to target only iOS 5.0 and later; then there is a built in class NSJSONSerialization, otherwise you should investigate SBJSON.

Related

What framework access sensitive user data that need NSBluetoothPeripheralUsageDescription key

I have gotten the following message from App Store Connect when trying to upload a new version...
Missing Purpose String in Info.plist File - Your app's code references one or more APIs that access sensitive user data. The app's Info.plist file should contain a NSBluetoothPeripheralUsageDescription key with a user-facing purpose string explaining clearly and completely why your app needs the data. Starting Spring 2019, all apps submitted to the App Store that access user data will be required to include a purpose string.If you're using external libraries or SDKs, they may reference APIs that require a purpose string. While your app might not use these APIs, a purpose string is still required. You can contact the developer of the library or SDK and request they release a version of their code that doesn't contain the APIs.
But I do not use bluetooth anywhere in the app (no bluetooth code).
Here are the frameworks I use:
CoreText, QuartzCore, CoreLocation, CoreGraphics, Foundation, UIKit, StoreKit, CoreData, MapKit
Any advice?
Open Info Plist file and press on + sign add new key in info.plist of your project and add this NSBluetoothPeripheralUsageDescription and write value "Explain the reasons for Bluetooth".
FacebookSDK is scanning Bluetooth since v 4.33. This is the description I have picked.
Facebook-SDK v4.34 contains Places Kit which contains Bluetooth scanning. This app isn't scanning/using Bluetooth at all.

Get file metadata from Amazon s3

Im trying to figure out how to access the metadata from Amazons3 in Xcode. I found a few examples of code but I am not able to access the S3ObjectMetadatRequest object. Its not even popping up in intellisense. All the other code examples use a lower version of AWS3 sdk for ios. Can anynoe point me in the right direction?
jarmods amnswer is correct there is an object called AWSS3HeadObjectRequest which i would use, But im using the AFNetworking Subclass called "AFAmazonS3Manager". Its a much easier way to implement all the AWS methods plus it expands upon an already greatly managed Networking system. So to be clear jarmods answer is correct but if you want to use the subclass i decided to use the function is "headObjectWithPath".

Get resources in converter?

What is the best way to get resource string or drawable in convert method of MvxConverter?
Can I access to current context or I have to manage static tracking?
Thanks
What is the best way to get resource string or drawable in convert method of MvxConverter?
There are some standard bindings that get access to resources, e.g.
MvxImageViewDrawableTargetBinding.cs
MvxImageViewImageTargetBinding.cs
There's also at least one example of using resources in a custom binding:
FavoritesButtonBinding.cs
You could do similar code in an MvxValueConverter rather than in a custom binding if you would prefer it (but that converter would not then be usable across multiple platforms).
Can I access to current context?
You can normally get access to Android Context objects using Mvx.Resolve<T> on:
IMvxAndroidGlobals.cs
IMvxAndroidCurrentTopActivity.cs
For i18n text cross-platform alternatives to Android strings are also available - from Vernacular and from Mvx - see http://slodge.blogspot.co.uk/2013/05/n21-internationalisation-i18n-n1-days.html
I have to manage static tracking?
No idea what this is. Sorry

How to find usage of non-public API in Mac Qt App

Our qtwebkit-based application is rejected by apple after submission to mac app store. One of the reasons for rejection is the usage of non-public API. I've managed found six of them in the source code for qtwebkit. But I have no where to find the rest. I searched through the source code of our application and the entire source code of QT.
The six non-public api I found in qtwebkit source is:
CFHTTPCookieStorageSetCookieAcceptPolicy
CFURLCacheCopyResponseForRequest
CFURLResponseGetMIMEType
CFURLResponseCopySuggestedFilename
CFURLCacheSetMemoryCapacity
CFURLCacheSetDiskCapacity
Here is the full list of violations found by apple:
The use of non-public APIs can lead to a poor user experience should
these APIs change in the future, and is therefore not permitted. The
following non-public APIs are included in your application:
NSAccessibilityCreateAXUIElementRef
NSAccessibilityHandleFocusChanged
NSAccessibilityUnregisterUniqueIdForUIElement NSAppKitPropertyCreator
NSCarbonWindowPropertyTag NSMouseMovedNotification
_NSDrawCarbonThemeBezel _NSDrawCarbonThemeListBox _NSPopUpCarbonMenu3 _NXShowKeyAndMain from the framework: '/System/Library/Frameworks/AppKit.framework/Versions/C/AppKit'
AXTextMarkerCreate AXTextMarkerGetBytePtr AXTextMarkerGetLength
AXTextMarkerGetTypeID AXTextMarkerRangeCopyEndMarker
AXTextMarkerRangeCopyStartMarker AXTextMarkerRangeCreate
AXTextMarkerRangeGetTypeID CTLineCreateWithUniCharProvider
CoreDragGetCurrentDrag CoreDragSetImage from the framework:
'/System/Library/Frameworks/ApplicationServices.framework/Versions/A/ApplicationServices'
GetNativeWindowFromWindowRef TSMGetInputSourceProperty from the
framework:
'/System/Library/Frameworks/Carbon.framework/Versions/A/Carbon'
CFReadStreamSignalEvent _CFAppVersionCheckLessThan
_CFBundleSetDefaultLocalization _CFStringGetUserDefaultEncoding from the framework:
'/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation'
CFHTTPCookieStorageCopyCookiesForURL CFHTTPCookieStorageDeleteCookie
CFHTTPCookieStorageGetCookieAcceptPolicy
CFHTTPCookieStorageSetCookieAcceptPolicy
CFHTTPCookieStorageSetCookies CFURLCacheCopyResponseForRequest
CFURLCacheSetDiskCapacity CFURLCacheSetMemoryCapacity
CFURLRequestCreateMutableCopy CFURLResponseCopySuggestedFilename
CFURLResponseGetExpectedContentLength CFURLResponseGetHTTPResponse
CFURLResponseGetMIMEType CFURLResponseGetURL
CFURLResponseSetExpectedContentLength CFURLResponseSetMIMEType
_CFNetworkHTTPConnectionCacheGetLimit _CFNetworkHTTPConnectionCacheSetLimit _CFURLCacheCopyCacheDirectory _CFURLRequestCreateArchiveList _CFURLRequestCreateFromArchiveList _CFURLResponseCreateArchiveList _CFURLResponseCreateFromArchiveList _CFURLResponseGetSSLCertificateContext _LSGetCurrentApplicationASN _LSSetApplicationInformationItem _kLSDisplayNameKey kCFStreamPropertyCONNECTAdditionalHeaders
kCFStreamPropertyCONNECTProxy kCFStreamPropertyCONNECTProxyHost
kCFStreamPropertyCONNECTProxyPort kCFStreamPropertyCONNECTResponse
kCFURLResponseExpectedContentLengthUnknown from the framework:
'/System/Library/Frameworks/CoreServices.framework/Versions/A/CoreServices'
NSPopAutoreleasePool NSPushAutoreleasePool from the framework:
'/System/Library/Frameworks/Foundation.framework/Versions/C/Foundation'
CARenderCGDestroy CARenderCGNew CARenderCGRender
CARenderNotificationAddObserver CARenderNotificationRemoveObserver
CARenderServerGetPort CARenderServerStart CARenderUpdateAddContext
CARenderUpdateAddRect CARenderUpdateBegin CARenderUpdateFinish
kCAContextPortNumber from the framework:
'/System/Library/Frameworks/QuartzCore.framework/Versions/A/QuartzCore'
If you have defined methods in your source code with the same names as
the above-mentioned APIs, we suggest altering your method names so
that they no longer collide with Apple's private APIs to avoid your
application being flagged in future submissions.
Additionally, one or more of the above-mentioned APIs may reside in a
library included with your application. If you do not have access to
the library's source, you may be able to search the compiled binary
using "strings" or "otool" command line tools. The "strings" tool can
output a list of the methods that the library calls and "otool -ov"
will output the Objective-C class structures and their defined
methods. These techniques can help you narrow down where the
problematic code resides.
I've finally traced down to the location where these so-called privatate apis are called. They are called from inside webkit. webkit uses a webkit system interface library which is directly supplied from apple in the format of compiled static library+header file. More specifically, they are the four files located under the path src\3rdparty\webkit\WebKitLibraries:
libWebKitSystemInterfaceLeopard.a
libWebKitSystemInterfaceLion.a
libWebKitSystemInterfaceMountainLion.a
libWebKitSystemInterfaceSnowLeopard.a
I always wondered if it's really a private api, who else would know how to call it without any documentation? Now it's turned out to be apple itself. Since neither nokia or digia has the source code to these libraries, there is probably nothing they can do about it.
Now isn't it ironic that any qtwebkit-based apps will be rejected by apple due to private api access from libraries created?
Please correct me if I am wrong or miss anything. I really hope I am wrong.

Saving Object to IsolatedStorage in WP7 with XNA 4.0

How can I go about saving an object of type GameSettings to IsolatedStorage on a Windows Phone 7 application made with XNA 4.0?
From what I can tell, you can't flag a class as serializable and ByteFormatter isn't available. I haven't come across a good way to convert an object to a byte array and write the array to the storage. And going beyond that, I have no idea how to go about converting said byte array back into an object.
Any help would be greatly appreciated!
There is no built in binary formatter on the platform but it does support XML and JSON serialization using the DataContractSerializer and DataContractJsonSerializer classes.
You can configure what is serialized via the DataContract and DataMember attributes.

Resources