cocoa-touch

view all the subclass of UIView or NSObject

You can view the Java API in tree structure. So you can view all the subclasses of Object. How would I view all the subclasses of UIView or NSObject IPhone Cocoa API? I just found out you can do this: self.tableView.tableHeaderView = searchBar; searchBar is subclass of UIView. I want to add a textField to a tableView. I wonder if ...

Setting a limit to a fetched property in Core Data

Hi I have a one to many relationship between two objects, lets call them Gallery and Images. Each Image belongs to a Gallery and each Gallery has many Images. I would like to add a fetched property to my Gallery model which would return one and only one Image object. Is there a way to do this with fetched properties? ...

Does ABPersonViewController CFRetain its displayedPerson ABRecordRef?

ABRecordRef addressBookRecord = ...; ABNewPersonViewController *newPersonViewController = [[[ABNewPersonViewController alloc] init] autorelease]; newPersonViewController.newPersonViewDelegate = delegate; newPersonViewController.displayedPerson = addressBookRecord; Is it safe to CFRelease(addressBookRecord); ? Is there a standard Co...

Can I create an new instance of my custom managed object class without going through NSEntityDescription?

From an Apple example, I have this: Event *event = (Event*)[NSEntityDescription insertNewObjectForEntityForName:@"Event" inManagedObjectContext:self.managedObjectContext]; Event inherits from NSManagedObject. Is there a way to avoid this weird call to NSEntityDescription and instead just alloc+init somehow directly ...

Why must I make an mutable copy of this array?

Apple provided this example: NSError *error; NSMutableArray *mutableFetchResults = [[managedObjectContext executeFetchRequest:request error:&error] mutableCopy]; if (mutableFetchResults == nil) { // Handle the error } Why are they calling mutableCopy here? Is it because they wanted to have an NSMutableArray rather than an NSArray,...

MUST I provide an NSSortDescriptor in core data when doing a fetch request?

I wonder if I could just execute a NSFetchRequest with just the Entity and nothing else. However, it seems to work with no errors, but since I've never seen anyone doing that, I wonder if there are any bad drawbacks in doing this. The documentation doesn't say if there's any default value used instead when I provide no NSSortDescriptor. ...

Can't get UIWEBVIEW working in any view controller other than app delegate

I've been messing around with some open source code trying to figure cocoa out. I've gotten an application with multiple views, and I want to put UIWEBVIEWS on the second, third, and fourth view controllers i've made. However for the life of me I can't seem to figure it out I can actually pull down on the touch screen a black/blank UIWE...

iPhone alloc or string literals for NSString?

I have a quick question about the two examples below. Currently I am using the top example on the understanding that because of the iPhones limited resources I am better off allocating and releasing manually as apposed to using the bottom string literal example. Does anyone have a preference as to which one to go with? if(activeSegment ...

Shake and tapping the status bar stop working after viewing an "in-app" movie

I have an application that exhibits the problem described in the title. After opening a youtube.com video within the app, tapping the status bar to scroll a tableView up, and shaking the iPhone cease to work. Any ideas? ...

How do I set up a proxy object in the main application NIB?

Hello! I would like to set up a proxy object in the application NIB file. The problem is that the NIB file is the main application NIB that gets loaded automatically by the application and therefore I cannot set up the UINibProxiedObjectsKey dictionary as described in the documentation. Is there a way to set up a proxy object in the main...

how to create multiple pages in Xcode iphone apps

Hi there, i am starting my experience with iphone sdk. and i have a question, which is i am trying to create two pages to the app but i don't know how to link them or design them. like when i start the Xcode i find one page named View to design in it, i want to make that page a welcoming page then the user choose one of the three choices...

iPhone - adding UIImage to array causes long loading time

I have 4 different types of imagearrays to use for animations. Each animationsequence consists of 14 png's that are 64KB each. Using Shark, it's obvious that this is the culprit to the long loading time. I'm not sure how much quality I can sacrifice but I assume lowering the size of the images by half would roughly reduce loading time ...

class/lib for parallel donwloads on iphone

Hi there! I need some class or lib that would allow me to run multiple parallel downloads. I didn't have luck finding any, do you guys know about something useful? I need to add new files to download dynamically, so something that only get initialized with urls at the beginning won't help me much. Any help would be greatly appreciated....

MKMapView tile-based overlay

I want to draw a tile-based overlay on top of a MKMapView, but there's no obvious way to do this. This appears to be tricky since you can zoom to any level with MKMapView (unlike Google Maps). Has anyone attempted to do this? ...

Is there a way to get a position (or center) state from a unfinished UIView animation?

I have a UIView doing a simple animation. It adjusts its y position from 100 to 130 and then reverses. I want it to keep repeating so I have the repeat counter set to 999. Upon user input, I want to take the same UIView and adjust the x position. This is done by means of another UIView animation. The problem is that when the 2nd ani...

[iPhone]A zone which user can't interact, why?

Plese refer to below image to get detail of my problem: This maybe relate to Status bar??? *Note: this is a full-screen application. My way to do this: 1. add "Status bar is initially hidden" information property to xxx-Info.plist. 2. In all screen of app: set "Status Bar" to none. ...

iPhone, differentiate between multiple controls?

What is the best way when setting up a UI for the iPhone to differentiate between multiple items of the same type (i.e. 2 sliders) currently I am assigning the controls unique "tags" and then querying them in Xcode. Is this the way to go or am I missing something else? -(IBAction)switchChanged:(UISwitch*)senderSwitch { if([senderSwi...

Cocoa Touch - How to check if a non-rectangular object in a UIImageView intersects another object?

Say I have a UIImageView that contains an image of an object that is not rectangular, i.e. a round ball. How can I check if another UIImageView (rectangular or not) intersects, or contains a point in, that object (not its frame)? Basic example: I have two balls rolling around on the screen, and I want to check for collision. But I don'...

Setting up a Navigation Controller with a Map View in Interface Builder

I'm trying to create a modal view which pops up when the user presses a button. The modal view has a navigation bar with a map view as the main view. I'm having trouble setting this up in Interface Builder. When I set the view outlet for my File's Owner's view to the view inside the Navigation Controller, the only thing that show up is t...

How to disable AM/PM in UIDatePicker

How to disable or hide AM/PM in UIDatePicker from code / interface builder? I want to have 24 hours time picker mode in UIDatePicker. Please help ...