iphone

Mem management for returned local variable

I am a little confused about retain/release count when a local variable is allocated within a method, then returned to its caller. For example -(NSMutableString*)foo { NSMutableString *str = [[[NSMutableString alloc] init] autorelease]; [str appendString:@"Just a test"]; return str; } NSMutableString *myString = [self foo]; ...

iPhone: determine distribution type programatically for testing.

At runtime in an iphone app, is there a way to distinguish the distribution type programatically between ad hoc and app store? Whenever I do an ad hoc distribution I want to target internal test servers for web service end points, then for the app store distribution target the production servers. Thanks. Jim ...

Core Data iphone debugging pointers

I have a reasonably complex Core Data app for the the iPhone. For the most part, it's working well, but I'm running into a sporadic problem that manifests itself within Core Data. I'm fetching data from a remote service, said service returns data. I parse the data and modify various managed objects. Then I save the managed object con...

slightly different scrolling needed after searching

I have a UISearchBar below a header-view. This header is 64px hight. If the searchbar gets touched, the parent view will move 64px up — fine. After finishing searching the parent view will only move down, as long there is still free space below it. And the top is out of the visible bounds. But I want to move it back to the original pos...

Is it possible to run the iPhone SDK from a flash drive?

I'm getting into iPhone app development, but I have neither the money for a mac mini, nor a PC with hackintosh compatible specs. However, my university has some mac labs that I can access, but to which I cannot install new software. As such, I'm wondering if there is a way to run the iPhone SDK from a usb drive, so that I can start pra...

iPhone SQLite question.

I have an sqlite table that shows scores from different game modes. In one of the columns, I don't want the score to show up unless the user reaches the final 5th level, but I also don't want it to be recorded as a 0 either. I want it to be as if the game was never played. No score recorded at all. Here's what I have.... if(appDeleg...

After using an NSArray *sort* method, am I responsible for releasing the returned array.

Hi, Im used to c programming where im responsible for freeing everything, and this objective c funky stuff is throwing some spanners in the work. I am using the below code. NSArray *b = [a allObjects]; NSArray *c = [b sortedArrayUsingDescriptors:sortDescriptors]; Who's responsible for releasing "b" and "c". For the record, "a" is a NS...

Organizer reporting, "The version of iPhone OS doesn't match iPhone OS supported for development"

Hello, Earlier this week I was developing to the device just fine. I upgraded itunes to the latest version (9.0.2 (25)) and I noticed that Organizer was throwing the: The version of iPhone OS on “sk’s iPhone” does not match any of the versions of iPhone OS supported for development So I figured I'd upgrade to the newest XCo...

How to mark multiple UITableViewCells and perform an action on marked cells?

Hello, I would like to do pretty much what the Mail Application does: that when I select Edit, instead of the usual Delete Button, Radio Buttons appear on the side that may be checked by the user, then the user may click on a Button to take an action on the marked cells(any kind of action not just delete). Is there any apple sample code...

access the dynamic buttons with tag

Hello I have some codes to create dynamic button as below: - (void)viewDidLoad { for (int i = 0; i < 9; i++) for (int j = 0; j < 8; j++) { forControlEvents:UIControlEventTouchDown]; UIButton *button = [UIButton buttonWithType:UIButtonTypeRoundedRect]; button.frame = CGRectMake(10+i*...

iPhone SDK: How can I copy a file to the iPhone simulator using XCode?

I need to know how to copy resources (help files, images, pLists) to the iPhone simulator and ultimately device. I thought this was done through XCode but I cannot recall the exact procedure. If someone could kindly provide some brief intructions.... Thanks in advance. ...

Selectors with arguments in Obj-C

So basically I have a big list of buttons that's present dropdowns and other things, and these buttons are created dynamically. So to capture the value for the appropriate button's data, I need to set it's action selector to a function that takes 1 extra parameter. For example, using this selector on this dropdown, with the method below...

In IB why can you not add multiple Bar Button Items?

In Interface builder, create a UIView, then a UINavigationBar and then attempt to add multiple UIBarButtomItems to that Navigation Bar. The resulting hierarchy should be: - View - Navigation Bar - Navigation Item (Title) - Bar Button Item - Bar Buttom Item I can never seem to add the second Bar Button Item. I know...

Good sources for custom controls for iphone development on the web?

I've looked hard and have been unable to find good websites that have aggregated custom controls that have been submitted by users to be shared with everyone. Does such a repository exist? I would hope something like this existed considering that iPhone developers seem to be using similar custom controls. In particular, I'm trying to d...

How to setup NSPredicate and NSEntityDescription in Coredata to do complicated SQL query

I know how to create NSPredicate to do sql like "SELECT * FROM DRINK". But how about this query: "SELECT I.name, D_I.amount FROM DRINK_INGREDIENT D_I, DRINK, INGREDIENT I WHERE D_I.drinkID=1 AND DRINK.drinkID=1 AND I.ingredientID = D_I.ingredientID;" How do I even set the NSEntityDescription, and NSPredicate for this kind of que...

NSFetchedResultsController based Table View always fails on SECOND insert of entity

I am using an NSFetchedResultsController to manage displaying fetched managed objects in a table view that has one section. The table starts out empty and the user can add new entities to it using the UI. As it stands, the program always works when adding the first entity, and always crashes when adding a second. There is sometimes no...

Library or code to XML to JSON

Does anyone know of a library that will convert XML to JSON in objective C (on the iPhone)? Thanks in advance, Rob ...

How and where to perform login process (in this case getting token from server) in iPhone app?

So what I need to do in my application for loggin in is Perform an HTML request with user/pass which returns XML with a token. The token is used in later http requests. I know how to perform http requests and also how to parse them, I have already been doing that just with the token hardcoded for testing purposes. I also have it worked ...

iPhone Core Location CLLocationManager update rate

Can you set up a constant time update rate for CLLocationManager to force it update locations like every 10 seconds continuously? I know the usage of the distance filter but what if something went wrong and the location is not updated? Thanks! ...

Not all embedded Youtube videos play on iPhone app

I've been using the standard method to embed a Youtube video in a UIWebview as a thumbnail to give the appearance of playing the video in the iPhone app. But many times the video either gives a broken play button or returns after 1 minute or so that the video could not be played. I assume this is because the poster either didn't ma...