objective-c

"UITextField isNaturallyRTL"

My iphone app crashes with the following error message: 2010-07-26 16:27:30.402 Nav[814:207] * -[UITextField isNaturallyRTL]: unrecognized selector sent to instance 0x3947fe0 2010-07-26 16:27:30.403 Nav[814:207] Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '** -[UITextField isNaturallyR...

downloading a movie file and placing it in the Videos directory... is that possible

I want to programattically pull a movie file down into a NSData object and write it to iPhone disk in the movies directory so that the user can open up their iPhone iPod section and watch the movies from there... Is that possible? Or do I need within my app to create a 'viewing' area, download the files to NSHomeDirectory add a folder i...

trying to do a REST web service using PUT in objective c (iphone)?

Hi, I have been trying to do a REST web service using PUT in iphone for days but with no luck. i'm wondering if anyone can upload a sample of doing REST web service using PUT or the approach to do? it will be of great help. Thanks ...

setObject:forKey: method of NSMutableDictionary

Is the first parameter supposed to be an object? A tutorial I'm following has the first parameter being textFieldBeingEdited.text, where it is defined in the .h file as UITextField *textFieldBeingEdited Isn't textFieldBeingEdited an object, and text is a property of that object? The following code crashes: [tempValues setObject:tex...

Making an array of integers in Objective-C

If you want to make an array of integers, can you use NSInteger? Do you have to use NSNumber? If so, then why? ...

extract parameter from UIWebView NSURLRequest

I have an url " http://www.website.com/?id=123&val1=abc&val2=x " I would like to get the value for the parameters such as "id" and "val2" how do I do that? ...

Ipad Error: 'Program received signal EXC_BAD_ACCESS'

I am getting this error when I deploy to my iPad. It does not occur in the simulator. My ipad app has three UIWebViews. The majority of this application is written completely as a web app, and uses CSS to make it look more native. Links that are clicked in the various web views will open in a certain one depending on the value of the re...

iPhone Objective-C: Disable the popping of the stack when clicking the tab with a navigation controller

Let's say I have a Tab Bar Controller with a tab A. A has a navigation controller, which lets me push new views onto the stack. Right now, if I tap A on the Tab Bar, all of the elements in A's stack will pop. Is there a nice way to disable this? I have a sequence of views that are displayed with the navigation controller that takes use...

objective-c macro for a variadic function

Hello, Here's an example of what i'm trying to achieve. I'm trying to create a macro, that would look like this: SOMEMACRO(obj, obj, obj, ..., obj); The macro would compile to: some_function(obj, obj, obj, ..., obj, SOMETHING_ELSE, SOMETHING_ELSE); Here's an example macro for a 1 parameter function: #define SOMEMACRO(x) some_func...

methods in objective-c

How come sometimes you need to put the method signature in the .h file and sometimes you don't? ...

Where can I download and use the AddressBookUI.Framworks?

Hi, everyone, I want to write an application about the address book UI in iPhone. I found that there are a framework which is AddressBookUI. But where can I find this framework? Do I need to download or found form somewhere? Thank you. ...

Convert Image to B&W problem CGContext - iPhone Dev

Hello, I am using a method to convert images taken with the camera into black and white. The problem I'm running into is that if the picture is taken in Portrait mode, it rotates and stretches in the next view. But, if is taken in landscape it is just find. I can only duplicate this bug when I convert the image to Black And White. Here...

Assiging base class pointer to derived class in objective c

I have a base class called ModelBase and I have a derived class called "Person". Now in the init method of person, I have something like -(Person*) init { if(self = [super init]) return self; return nil; } However, Objective C complains that Incompatible Objective-C types initializing 'struct ModelBase *', expecte...

Image in bundle not found using NSBundle

Hey internets! So here's the deal: I have an image in the Resources folder of custom framework that I use as a default for classes in the framework. However, when I create these classes in projects that link against my framework they fail saying they can't find the image. I'm guessing the NSBundle's +mainBundle does not search the cor...

Does Cocoa have a @protocol for iterable / collection objects?

I'm writing an API, and I'm a firm believer of putting as much type safety as possible into APIs. Is there a @protocol for things like NSSet, NSArray, etc that marks it as "iterable" in a for (foo in bar) {..} style loop? At the moment I've got something like this: - (void) doSomethingWith:(id)someItems; When I'd like to have somethin...

How to retrieve the First Name and Last Name from the AddressBook?

Hi, everyone, I want to ask about the address book framework on iPhone application. I have import the framework and .h in my class. However, I don't know how to retrieve all of the First name and last name in the address book and store it in the NSMutableArray. what is the problems in my code? Thank you very much. NSArray *displayedIt...

how we can use the core data in navigation views

I made a simple project in navigation view, but when I thought to implement the core data with my application then the option of code data in mentioned only in Window base application. Can we use it in navigation view? How? ...

Memory leak identified for NSURLConnection

Hi, When i run the instrument i got memory link in below line NSData *responseData = [NSURLConnection sendSynchronousRequest:theRequest returningResponse:&urlResponse error:&error]; Can some one explain me how to fix this issue, Thanks Sam. - (NSString *)sendHttpsReq:(NSString *) urlString { // create the request NSString *...

ABContact setImage, thumbnail problem?

I have setup addressbook contact's images using a code, it works well and the image is there when I browse the Addressbook, But when a call comes, it only shows a thumbnail? I want to show the full image instead the thumbnail? Is it a bug? NSData *dataRef = UIImageJPEGRepresentation(entry.recIcon,1.0); CFDataRef cf...

iphone : install developer build into devices not added to provisioning

Hi, A have created a build. with a provisioning profile. Now there is a new device i have to install the build. but that is not in the provisioning. Now i have to modify the provisioning. add device into it. download provisioning again and build again with new provisioning. now this new build will be installed into new provisioning. ...