iphone

What is the best way to properly test object equality against an array of objects?

My objective is to abort the NSXMLParser when I parse an item that already exists in cache. The basic flow of the program works like this: 1) Program starts and downloads an XML feed. Each item in the feed is represented by a custom object (FeedItem). Each FeedItem gets added to an array. 2) When the parsing is complete the contents ...

How to manage a complex subview on the iPhone

Hi all, I have a view controller that manage a view with a table view, a toolbar, a navigation bar and so on. Inside the toolbar, I have a GPS signal indicator. It is composed of a number of bars with different heights, different colors, and so on depending on signal quality. The GPS signal indicator is a complex (sub)view that I want...

Manually changing keyboard orientation for a view that's on top of a camera view

I'm basically trying to reproduce the core functionality of the "At Once" app. I have a camera view and another view with a text view on it. I add both views to the window. All is well so far. [window addSubview:imagePicker.view]; [window addSubview:textViewController.view]; I understand that the UIImagePickerController does not supp...

MVC, can model save/load its data?

Quick question, my data model is a singleton object and it contains a list of names that I want to archive. My idea is to make the model responsible for loading and saving it's own data. The model's load method will be called by the ViewController's viewDidLoad method and save by the ViewController's applicationWillTerminate. I could do ...

iPhone MapKit - Go "Around the World" ?

I have an App that is using MapKit. I am dropping pins and everything else, but when I zoom out to view the entire world, it does not let me go past the the middle of the Pacific Ocean. If I am viewing California and want to go to China, I have to scroll all the way East to view it. Is there a setting that I need to turn on, or is this...

Custom Keyboard (iPhone), UIKeyboardDidShowNotification and UITableViewController

On an iPhone App, I've got a custom keyboard which works like the standard keyboard; it appears if a custom textfield becomes first responder and hides if the field resigns first responder. I'm also posting the Generic UIKeyboardWillShowNotification, UIKeyboardDidShowNotification and their hiding counterparts, like follows: NSMutableDic...

UIImagePickerController Save to Disk then Load to UIImageView

Hi, I have a UIImagePickerController that saves the image to disk as a png. When I try to load the PNG and set a UIImageView's imageView.image to the file, it is not displaying. Here is my code: (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info { UIImage *image = [in...

How to specify a group when displaying an ABPeoplePickerNavigationController

Does anyone know how to specify a group when initially displaying an ABPeoplePickerNavigationController (so it doesn't automatically display "All Contacts")? ...

About Use _xmlSchema in iPhone Developer

I want to know how to use "_xmlSchema" in and it can to associated to (.NET DataTable)? ...

Best FTP Objective-C wrapper for iPhone

I know you use the C based networking API to do FTP communication but I'd prefer to use something a little higher level. I've seen a few Objective-C based wrappers but I'm not sure what to use. I don't need that complex of FTP interaction. Its just the typical create/delete dirs, upload/download files... What do you recommend? Edit: Her...

Memory leak when returning object

I have this memory leak that has been very stubborn for the past week or so. I have a class method I use in a class called "ArchiveManager" that will unarchive a specific .dat file for me, and return an array with it's contents. Here is the method: +(NSMutableArray *)unarchiveCustomObject { NSMutableArray *array = [NSMutableArray a...

novice needing help on shuffeling an array

Please help a TOTAL beginner.! I found this post: http://stackoverflow.com/questions/56648/whats-the-best-way-to-shuffle-an-nsmutablearray And as i try to deploy this in my own code, I cant get it working... :-( Can anyone help me to resolve this code? To me it looks like the shuffle function is not called..? here is my code: // //...

How to call a method of a specific class from another class (created in this specific class) ?

I created a TTModelViewController. in the createModel Method i created a TTURLRequestModel. after Loading content in the TTURLRequestModel i want to call a method in my TTModelViewController. TTModelViewController - (void) createModel { requestModel = [[singlePostModel alloc] initWithId:@"54"]; } - (void)didLoadModel:(BOOL)firstT...

MPMoviePlayerController S3 authentication

I'm trying to stream a video that is stored on Amazom S3 services. I've tried passing the url with authentication using MPMoviePlayerController but with no success. Like this: http://theusername:[email protected]/path/to/the/video Have anyone done this before? I would like some advices, thanks. ...

NSNotification vs. Delegate Protocols?

I have an iPhone application which basically is getting information from an API (in XML, but maybe JSON eventually). The result objects are typically displayed in view controllers (tables mainly). Here is the architecture right now. I have NSOperation classes which fetch the different objects from the remote server. Each of these NSOpe...

When overriding initWithCoder is it always necessary to call [super initWithCoder: coder]

In this code I am loading a View Controller (and associated View) from a .xib: -(id)initWithCoder:(NSCoder *)coder { [super initWithCoder:coder]; return self; } This successfully works, but I do not really understand what the line [super initWithCoder:coder] is accomplishing. Is that initializing my View Controller after my Vi...

Animate programmatically added subviews

Hey, I've setup an own class(custom UIView). I'am adding two of these customViews to my UIView as subviews. So now the question araises: How do I animate the subviews? myCustomView *myCustomViewInstance = [[myCustomView alloc] initWithText:@"myText"]]; [self.viewContainer addSubview:myCustomViewInstance]; myCustomView *myCustomVie...

Returning objects with autorelease but I still leak memory

I am leaking memory on this: my custom class: + (id)vectorWithX:(float)dimx Y:(float)dimy{ return [[[Vector alloc] initVectorWithX:dimx Y:dimy] autorelease]; } - (Vector*)add:(Vector*)q { return [[[Vector vectorWithX:x+q.x Y:y+q.y] retain] autorelease]; } in app delegate I initiate it: Vector *v1 = [[Vector alloc] initVector]; Vec...

How can I present a modal view controller after selecting a contact?

Hey everyone, I'm trying to present a modal view controller after selecting a contact and it doesnt seem to be working. In my - (BOOL)peoplePickerNavigationController:(ABPeoplePickerNavigationController *)peoplePicker shouldContinueAfterSelectingPerson:(ABRecordRef)person method, I dismiss peoplePicker, create an instance of my new...

FBConnect on iphone

Hi, I've integrated one of my iphone app with facebook. And i'm facing a small issue in canceling an ongoing request. I'm using this function [[FBRequest requestWithDelegate:self] call:@"facebook.friends.get" params:params] to raise a request and - (void)request:(FBRequest*)request didLoad:(id)result to get the friends list. This functi...