Application shows information about planets, their moons, and etc. It shows a list of planets, let user select a planet and see its details and then bookmark/unbookmark it. I have a view which shows user the details of selected planet, it also contains a add/remove bookmark button. If user clicks that button, that bookmark is added/remov...
Exact duplicate:
Why do Objective C files use the .m extension?
I'm thinking .h stands for header. I suppose .m could stand for main, but I don't know. Do any of you actually know this?
Just to clarify, I know what goes in which file, i.e. I know the purpose of each filetype, I'm just curious if the filetype symbol has a meaning.
...
I have a @property which is defined like this :
@property (nonatomic, retain) name;
In a function I parse some xml and set the name property.
My question is should I explicitly release previous retained instance before retain a new one ?
For exemple :
myObj.name = [otherObj getName]; // retain count +1
..
myObj.name = [otherObj ge...
Hi!
In one of my iPhone projects, I have three views that you can move around by touching and dragging. However, I want to stop the user from moving two views at the same time, by using two fingers. I have therefore tried to experiment with UIView.exclusiveTouch, without any success.
To understand how the property works, I created a br...
I have already created a status item for the menu bar but I would like to add a checkbox to make it able to be toggled on and off.
So when the check box is checked the status item is displayed and when the checkbox is not checked it is not displayed.
What code would i need to do this?
...
I'm not very sure about this. I think that an "property" is an instance variable that has accessor methods, but I might think wrong...
...
Using interface builder you can select the corners an object should stick to when resizing. How can you do this programatically?
...
I use Python 2.6 more than I use Leopard's default python installation, so I have it set as my main Python installation. But I'd rather use the default Python for a PyObjC program I'm working on. Is there any way to specify to only use it instead of Python 2.6?
...
Im working on an iphone app that uses rss.
When I scroll my UITableView, if i bounce the bottom too much my app crashes and i get TERMINATING_DUE_TO_UNCAUGHT_EXCEPTION any suggestions? Here is my code:
http://pages.stern.nyu.edu/~abc329/SS/
Here is the error I get:
warning: Unable to read symbols for
"/System/Library/Frameworks/UIKit...
I'm messing around with Core Data, and I am sure I am missing something obvious, because I cannot find an example that at all resembles what I am trying to do.
Let's say I'm playing around with a DVD database. I have two entities. A Movie (title, year, rating, and a relationship to Actor) and Actor (name, sex, picture).
Getting all the...
If you initialize an NSMutableArray with NSArray's convenience method as above, do you get an NSArray or an NSMutableArray?
Any consequences?
(I know that NSMutableArray has "arrayWithCapacity:, I'm just curious)
...
I've got an NSArray and have to iterate over it in a special case backwards, so that I first look at the last element. It's for performance reasons: If the last one just makes no sense, all previous ones can be ignored. So I'd like to break the loop. But that won't work if I iterate forward from 0 to n. I need to go from n to 0. Maybe th...
I see some example code with [super viewDidLoad] called before your implementation and after your implementation.
I know you don't always have to call super (as seen in many other discussions).
When you do call it, is it expected before or after you code?
This could have consequences depending on what super's implementation does. Thou...
After reading lots of blogs, forum entries and several Apple docs, I still don't know whether extensive subclassing in Objective-C is a wise thing to do or not.
Take for example the following case:
Say I'm developing a puzzle game which
has a lot of elements. All of those
elements share a certain amount of the
same behaviour....
How do I upload custom images to my tab bar in the iPhone SDK?
I uploaded an image, added it to resources, and tried to make it the image for a tabbar item. This is what happened:
http://www.mediafire.com/download.php?tmn1xtnmjhz
Thanks
...
I want to convert a float to a NSDate
I converted a NSDate into a float using this:
// Turn the date into Integers
NSCalendar *calendar= [[NSCalendar alloc] initWithCalendarIdentifier:NSGregorianCalendar];
NSCalendarUnit unitFlags = NSHourCalendarUnit | NSMinuteCalendarUnit | NSSecondCalendarUnit;
NSDateComponents *dateComponents ...
What does @private mean in Objective-C?
...
I've seen usage of Objective-C protocols get used in a fashion such as the following:
@protocol MyProtocol <NSObject>
@required
@property (readonly) NSString *title;
@optional
- (void) someMethod;
@end
I've seen this format used instead of writing a concrete superclass that subclasses extend. The question is, if you conform to th...
Hi,
I am creating a syntax highlighter for the iPhone and in order to display text with multiple formats, I have sub-classed UIView and modified the drawRect: method so that each line is displayed with the proper syntax highlighting (highlighting is done earlier with RegEx, text is drawn with CGContextShowTextAtPoint() one line at a tim...
I am writing an application using Core Data to control a few NSTableViews. I have an add button that makes a new a record in the NSTableView. How do I make the focus move to the new record when this button is clicked so that I can immediately type its name? This is the same idea in iTunes where immediately after clicking the add playli...