objective-c

Facebook iOS SDK - log in without promting user

Hey! I am making an app to read news articles from a website on the iPhone. I would like to be able to share these articles on Facebook, using a password and email-address that was set somewhere programmatically (not using Facebook-Connect, mostly because I want the design to be the same, whether you log in to Twitter from the app or in...

Methods That Call Methods: Basics of Autorelease?

Just when I thought I've understood this topic completely, I'm back to basics. I have a method that instantiates an autoreleased object, using (for example) stringWithFormat: return [NSString stringWithFormat:@"what"]; Then I call this method from another method, and another method, each time returning this autoreleased NSString and ...

strange error iPhone/iPad

Hello stack overflow, So I have a table view that contains a bunch of data. The user can navigate down, browse edit, etc. However when they edit and delete a row, and then navigate back via the nav controller, sometimes (not all the time) the app crashes throwing this error: -[CALayer resourceType]: unrecognized selector sent to inst...

Observing the editing property of a UITableViewController

Why can't I observe the editing property of an instance of UITableViewController? I'm using the following code: [self addObserver:self forKeyPath:@"editing" options:(NSKeyValueObservingOptionNew | NSKeyValueObservingOptionOld) context:NULL]; And have implemented the method: - (void)observeValueForKeyPath...

Naming guide for Objective-C classes

Hey, If my application is called "Media Player", is it a best practice to name classes: MPSong, MPSinger, MPAlbumsViewController ... ? ...

What's the right way to base64 Encoding in Cococa?

I'm enconding this data with this line: NSString *authString = [[[NSString stringWithFormat:@"%@:%@", email, password] dataUsingEncoding:NSUTF8StringEncoding] base64Encoding]; for a basic HTTP Authentication It works quite perfect but i'm getting this warning: warning: 'NSData' may not respond to '-base64Encoding' is there ...

iphone sdk: Adding data to sqlite database not working !?

hi, i use the code below to insert data into my sqlite-database but for some reason the application always crashes as soon as the method gets called and the problem seems to be the "sqlite3_open" statement. Does anyone have any idea what i might be doing wrong? - (void)viewDidLoad { [super viewDidLoad]; self.title = @"Animals"; animals...

How to check if an object exists in an NSMutableArray

Is there a method, like containsObject: for NSMUtableArrays to check if an object exists in there without having to loop through the whole array and check each element? What's the best way to check if an object exists in an NSMutableArray? ...

When is an IBOutlet UIViewController inited, if set as a property? How to optimize IBOutlet UIViewControllers' loading?

I have my main app view controller (File's Owner), its First Responder, View, and 3 other UIViewControllers in the same nib file. Every one of the 3 UIViewControllers is referenced on the main UIViewController as an IBOutlet. My question is, when does the main UIViewController init those 3 UIViewControllers, in its life cycle (my guess...

custom behaviour to iphone addressbook ui controller

is there any way to customize the ABPeoplePickerNavigationController and let user select multiple contacts without going into details? I can push contacts into an array as user selects them but there's no way to give visual feedback back to user that he/she selected the contacts he clicked (or unselect them on second click). I don't wan...

How to implement NTLM Authentication for UIWebView?

I have a use case where a UIWebView may need to connect with a web server secured with NTLM. I also have a use case where I already have the credentials to be passed. So instead of forcing the user to enter them, how do I perform the handshake with the UIWebView? UPDATE: Using this method here works well enough when you are doing sim...

Picker does not recognize the last row

Hello! This seems like pretty standard code straight from the doc, so I'm not sure what I am doing wrong... My 3-component picker doesn't look right when it loads, with the selection indicator being placed too low across the picker (so the grey bar is correctly placed, but the clear raised-looking overlay is too low). Then, when I sel...

Programmatically Altering Images

I'd like to alter images programmatically. Specifically for the iPhone, but, general answers could help. For example, how could I, programmatically, add filters effects, such as those available in Photoshop. Clearly it is possible as exemplified by apps such as Fat Booth. What is the starting point for this? Load an image as NSData and ...

Can i get/set the index generated by checking the 'indexed' checkbox? (core data)

I have 2 entities. entity A will hold many entity Bs and order will matter. if i check the little box that says 'indexed' in xcode, how do i go about using that index, if i even can? ( i know that i CAN use it in some way: http://cocoawithlove.com/2008/03/testing-core-data-with-very-big.html but i am not so spiffy with Obj-c yet.) I h...

How can I call an Objective-c static method asynchronously?

How can I call a static method asynchronously? + (void) readDataFromServerAndStoreToDatabase { //do stuff here //might take up to 10 seconds } ...

Writing an array of NSData to file

I am trying to save an array of images to the documents folder. I managed to save an image as NSData and retrieve it using the method below, but saving an array seems to be beyond me. I've looked at several other questions that relate and it seems I'm doing everything right. Adding the image as NSData and saving the image: [imgsData a...

Is there an easy way to change a NSWindow NIB into a NSView NIB?

I started out with some items as NSWindows but my GUI is evolving and these elements would be better suited as NSViews. Is there a way to convert an NSWindow NIB into an NSView NIB? ...

Can I call libxml parser from multiple asynchronous network calls?

I have a piece of code that uses NSURLConnection to fetch a network resource asynchronously and parse some XML as it streams in. The XML parsing is handled by libxml2 which is available as a framework in the iOS SDK. This works perfectly when I invoke it once, parse the XML and release the resources by calling xmlFreeParserCtxt(ctxt). ...

Data Exchange between same iPhone App on separate devices

Hi all I am developing an app on iphone that lets user take photos, add comments & GPS location to it and send it as an email to another user. If the recipient has installed the same app & when she clicks on the attachment the same app will launch & parse these details & show them to the recipient. (I intend to use UIDocumentInteractio...

COCOA objective C

how we can change the tabbarcolor ...