cocoa-touch

Left aligned image in iPhone navigation bar

Hi, currently I'm doing self.navigationItem.titleView = [[[UIImageView alloc] initWithImage:image] autorelease]; to set an image in the navigation bar. This way it is centered automatically. Is there any way to have it left aligned ? ...

Core Data unique attributes

Is it possible to make a Core Data attribute unique, i.e. no two MyEntity objects can have the same myAttribute? I know how to enforce this programatically, but I'm hoping there's a way to do it using the graphical Data Model editor in xcode. I'm using the iPhone 3.1.2 SDK. ...

Horizontal UIScrollView with images in a component?

Hey guys, I've started implementing a UIScrollView that will contain many thumbnail-sized pictures and will scroll only horizontally. For this, I keep a limited number of UIImageViews created and remove/add them to the UIScrollView as the user scrolls it. The problem is I need to find a way to optimize it as scrolling sometimes gets sl...

linux language to use to mirror iphone development

I want to create a gui program in linux which I eventually might move to the iphone. What programming language and GUI framework should I use to make this easiest? I'd assume using Objective-C would be best, since gcc will compile that, but are there GUI frameworks that work with Objective-C that are similar to Cocoa and won't require ...

Flip tableview inside navigationcontroller

I'm learning cocao touch, and trying to make an app with a tabbar, various views, one of them af navigation controller, controlling a normal table with a normal tree architecture. In one of the tableviews I want to flip a different tableview, also capable of navigating down multiple tables. The way I've tryid to make it, is with a sta...

YAML/JSON/XML which one to choice on IPhone for communication over RESTFul protocol?

I'm writing as simple application that comunicate with an external server. The server currently support yaml, xml and json. Which encoding is fastest on IPhone? Which has better support? What libraries do you suggest? ...

How do you manage releasing an object created in an instance method on iPhone without autorelease?

I'm fairly new to iPhone development and I've hit a roadblock in my understanding of memory management. I've read through the Memory Management Guide for Cocoa and have read many, many questions and answers on SO, but have not found a complete answer. If I have an instance method that creates an object, every example I've seen seems to ...

How to stop UITableView moveRowAtIndexPath from leaving blank rows upon reordering

I am having an issue where in reordering my UITableViewCells, the tableView is not scrolling with the cell. Only a blank row appears and any subsequent scrolling gets an Array out of bounds error without any of my code in the Stack Trace. Here is a quick video of the problem. Here is the relevant code: - (BOOL)tableView:(UITableView ...

What are the limitations on filenames saved to the iPhone?

I can't seem to find any documentation on this. Is there a limit to the number of characters that can be used in a filename and/or is there a restriction on what characters can be used in a file name saved by an iPhone app? Thanks. ...

How to fix an imageView to another and move both together?

Hi, all! I'm developing a game in which I have a bow and arrow. I have to move both bow and arrow imageViews on touch through different angles for which I'm applying CGAffineTransform. The problem is this that after rotation, bow and arrow change their positions, so the arrow does not stay at the center of the bow. I want to fi...

Declare at start, or as you go?

I would say this is pretty much a style / readability thing, although I do see nearly all objective-c/cocoa formatted as per "METHOD_002". I am just curious if "METHOD_001" would be considered bad style, there are advantages to having all the declarations at the top of a method, but then again there are disadvantages in terms of readabil...

iphone compass interference detection

How can I tell from my app if the compass has interference and ask the user to re-calibrate it? I want to get the same behavior as the google maps app has when there are compass interferences. Thanks. ...

Using accessor methods to set iVars?

Initially, I was looking at the way "pickerData" is set and thinking I wonder why you can't just assign it directly (as in METHOD_002), but then I stated thinking that I should really be using the accessor methods I defined and not setting the instance variables directly. Am I understand this correctly that METHOD_001 is a better way of ...

Best way to center a UILabel in a UITableViewCell that's dynamic in height?

I'm trying to place a UILabel directly in the middle of a UITableViewCell vertically. Essentially I'm doing something such as: float yPos = self.contentView.center.y; I then assign yPos to my UILabel and add it as a subview of self.contentView within my UITableView subclass. This still doesn't appear to be smack in the middle of the c...

Does dealloc get called after viewDidUnload?

A quick question, after viewDidUnload does the dealloc also get called? I am asking with regards to pickerData, it was my understanding that the variable would be released when the dealloc gets called. My reason for asking is that I have noticed in one book that the author sets pickerData to nil in the viewDidUnload. Is this harmless ove...

How to check if an object is already in the database before saving a new one?

Example: I have a list of friends which I retrieve as XML from a web server. On the device I want to store those friends with an update feature locally. But I only want to store NEW friends. To keep it simple I distinguish them by their first name only (yes thats bad!). As the XML parser walks through the XML, it generates managed objec...

Offset on UIWindow addSubview

I've got a UITabBar based application that works just fine. Under certain circumstances I am showing a different UIViewController instead though. Now what bugs me is that that I have to adjust the frame for the Test nib (and only the Test nib!) to display correctly. (Otherwise the view is below the status bar). - (void)applicationDidFin...

Using the UIImagePickerController image editor seperately

When you are using an UIImagePickerController, you have a property called allowsImageEditing, which makes it possible to zoom in/crop/etc a picture, after you picked a picture (from camera or library). I would like to use this editor just with an UIImage as a source, the images are loaded from the internet and I want the user to be able...

Does dealloc get called on iPhone?

I have noticed whist learning how Cocoa-Touch works over the last few weeks that dealloc methods don't seem to be getting called when I exit the app in the iPhone simulator. Now to be fair I am not doing anything too scientific just putting in NSlog statements that can print to the console. My questions is: (1) Does the simulator discon...

iPhone view hierarchy question: How do I draw views over the tab bar?

I am having some trouble with view hierarchies and drawing on the iPhone. To be more specific, I have a tab bar application with a certain tab that contains a table view where I would like the selection of a specific cell to have a UIPickerView slide up. The sliding isn't really a problem (or at least I'm assuming it won't be once I fig...