objectiveflickr icon indicating copy to clipboard operation
objectiveflickr copied to clipboard

EXC_BAD_ACCESS on function initWithAPIKey

Open hydex86 opened this issue 14 years ago • 4 comments

I'm getting an EXC_BAD_ACCESS when debugger is processing function initWithAPIWey on OFFlickrAPIContext class.

When debugger is at this point:

 - (id)initWithAPIKey:(NSString *)inKey sharedSecret:(NSString *)inSharedSecret
 {
    if ((self = [super init])) {
       key = [inKey copy];

On the last code line, I can see inKey has the value of the constant I defined on SampleAPIKey.h . inKey is a NSCFString and key is NSString. Key value is nil.

Do you know what could it happens? I'm using Xcode 4.

Thanks for your help!

hydex86 avatar Sep 08 '11 01:09 hydex86

If I change the code line for the next one, there is not EXC_BAD_ADDRESS at this point.

self.key = [inKey copy];

And key property retain instead of readonly.

I think I'm doing something bad. Or the library doesn't work with the latest iOS sdk version?

Thanks

hydex86 avatar Sep 08 '11 22:09 hydex86

I closed the issue accidentally.

hydex86 avatar Sep 08 '11 22:09 hydex86

I have the same issue... exactly on the same line. I'm using Xcode 4.1 and my project targets iOS 4.3

@hydex: have you resolved this issue? Did you find any solutions?

ghost avatar Sep 21 '11 19:09 ghost

@mediamac1 I solved the issue. Don't know what did exactly, but the problem was about linking the library, choosing the architecture which it was compiled, or something like this. As you could see, the way described in the guide about linking the library doesn't apply to Xcode 4.1.

When I solved the problem, I got an EXC_BAD_ACCESS on the next line:

RESTAPIEndpoint = kDefaultFlickrRESTAPIEndpoint;

I solved this changing the next code lines:

` RESTAPIEndpoint = kDefaultFlickrRESTAPIEndpoint; photoSource = kDefaultFlickrPhotoSource; photoWebPageSource = kDefaultFlickrPhotoWebPageSource; authEndpoint = kDefaultFlickrAuthEndpoint; uploadEndpoint = kDefaultFlickrUploadEndpoint; ``

to:

self.RESTAPIEndpoint = kDefaultFlickrRESTAPIEndpoint; self.photoSource = kDefaultFlickrPhotoSource; self.photoWebPageSource = kDefaultFlickrPhotoWebPageSource; self.authEndpoint = kDefaultFlickrAuthEndpoint; self.uploadEndpoint = kDefaultFlickrUploadEndpoint;

but I had problems later. Finally I decided not to use this library and choose a generic OAuth library. Mabye some other person could show us the light.

hydex86 avatar Sep 21 '11 21:09 hydex86