function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Jorge2Jorge2 

Native iOS SDK issue - WebKit error: "-[UIDevice macaddress]: unrecognized selector"

Error using native iOS mobile SDK:

 

After entering credentials and approving access in the web view, I get the following error in the iPhone simulator:

"*** WebKit discarded an uncaught exception in the webView:decidePolicyForNavigationAction:request:frame:decisionListener: delegate: <NSInvalidArgumentException> -[UIDevice macaddress]: unrecognized selector sent to instance 0x6e521f0"

 

The screen is then blank. I can see in the SFDC web UI that the app was authorized, but - oauthCoordinatorDidAuthenticate:coordinator is never called...

 

Any idea what's going on here?

 

Thanks

Kevin HawkinsKevin Hawkins

[UIDevice macaddress] is in a category extension to UIDevice, used by the SDK to grab the device's MAC address.  Is it possible that you have other category extensions to UIDevice in your app, which would interfere with this one?  Are you using the SDK from the master branch, or the unstable branch?

 

Jorge2Jorge2

@Kevin Hawkins:

 

Per the instructions, I cloned and built the repository at:

git://github.com/forcedotcom/SalesforceMobileSDK-iOS.git

 

Is that the master branch? I didn't even see any other branches...

 

My existing project, not built using the Salesforce Mobile SDK template (and with ARC enabled), just uses standard iOS UI components, and view controller subclasses -- I haven't written any category extensions to UIDevice, and am not using any other non-Apple libraries.

 

Thanks

Jorge2Jorge2

Kevin,

I looked again at the github UI and the SourceTree git app I use, and I do believe I cloned the master branch.

But still encountering the WebKit exception and a blank screen after authentication...

Thanks

Kevin HawkinsKevin Hawkins

Do you get the same behavior when you launch your app on a physical device?  What version of Xcode are you running, and what's the base version of the iOS SDK that you're targeting?

Jorge2Jorge2

Kevin,

 

I haven't launched the app yet on a physical device.

Version of XCode = 4.3.2

Deployment target = iOS 5.1

 

After many hours of trying to figure this out, I started a new, clean project from scratch (not using the SDK's template) and managed to get the OAuth authentication to work, and without the UIDevice error. I'm still new to iOS & XCode and don't understand all the compiler and linker options yet, so maybe I had something set that shouldn't have been...

 

Thanks for your help

jgojgo

I was having problems with this myself (a very long time), then I tried going through the readme from their github site. After adding :

 

  • Set Other Linker Flags to -ObjC -all_load

It worked. Hopefully if there are anyone else out there having problems like I did, this will solve it. 

N4S_goldN4S_gold

I also have same proble , can any one help for me.

 

Thanks

JbeatleJbeatle

This worked for me. I think this works for all static libraries!!!

NivasNivas

It is working now thanks