Hallo,
I am trying to set up some unit tests for code that accepts an *NSError as an argument. If there is a validation problem, then the object is not saved and the NSError condition is set.
My method is:
- (BOOL)validateConsistency:(NSError **)error {
... code omitted for brevity ...
if (errorCondition == YES) {
N...
Hi,
I am developing an iPhone application with multiple table view. On each UITableview I have to load RSS feed data. Each feed has its own image.
For a single feed, I try to parse the xml and load the image inside the delegate itself.
Can any one advise me how to implement the lazy loading for all Rss feed view?
...
/*h file:*/
IBOutlet UITextField *Number;
/*m File:*/
[(Number) setText: [[NSUserDefaults standardUserDefaults]
stringForKey:@"SBFormattedPhoneNumber"]];
Any idea why this is not working ?
Thanks
...
If I have a UIPopoverController (in .h file) and alloc init it multiple times in the same .m file. do I need to release it once to multiple times?
...
Hi,
i want to floor a double by its decimal place with variable decimal length (in iphone sdk).
here some examples to show you what i mean
NSLog(@"%f",[self floorMyNumber:34.52462 toPlace:2); // should return 34.52
NSLog(@"%f",[self floorMyNumber:34.52662 toPlace:2); // should return 34.52
NSLog(@"%f",[self floorMyNumber:34.52432 toP...
Hi,
I am looking to learn Java to make a few Android apps but what I am wondering is if I learn Java, will Objective-C make alot more sense to me? I did hear something like this a while ago on some tutorial but am not sure.
Thanks
...
I am working on a game in OBJ C that has a ball view and a stage view. The stage view has 4 subviews. All views are UIImageViews. I have a method for collision detection that is working. I would like to expand it to more than 4 subviews without simply creating more lines of code. Looking at the code below, is there a way to simplify this...
I have a screen which functions similarly to the address book contact screen.
The screen displays some data in a UITableView and provides an "Edit" button.
When the user presses "Edit" the UITableView is animated to display the data in "Edit Mode".
There is not a 1:1 relationship between the fields in "View Mode" and the fields in "...
i have a textfield,
Number and Password
i have no clue how to save these settings and then read them as the app starts to check if they have been set or not.
Thanks
Mason
...
I'm trying to set up a view that gives feed back via progress bar while it carries out a task, by incrementally sending updates to the view.
I don't know much about multithreading, so I'm trying to do this without using it. Is there a way to force a view to update? It seems like there should be something to do this, cause I'm not really...
I think this should be a very easy one, but I cant find the answer on the docs.
I want to stop mouse dragging events which are in (or start in) my custom nsview subclass from causing the window to be dragged around the screen. How can I tell the window to stay still so i can interact with the view instead of dragging the whole window ar...
I'm writing a Cocoa app that will need access to multiple file transfer protocols, such as FTP, Amazon S3, etc, and I was planning on using the ConnectionKit framework to implement them. However, even though I managed to get it compiled (which is quite a feat itself), it seems to be missing a number of it's header files, such as the S3 p...
I'm picking up ObjC and Cocoa, which is also my first serious foray into programming in general.
I'm having trouble with the differences between initWith methods, which are called on instances, and factory methods, which are called on classes.
Firstly, why are they called "factory" methods, and is there a proper term for what I've dubb...
I was recently told casting [NSNull null] to (NSString*) was "terrible".
However, -[NSDictionary stringForKey:] method will return [NSNull null] if the key is not in the dictionary, and if I don't do the cast the compiler yells at me.
Am I missing something?
EDIT:
My mistake... and I think I might be beginning to see the problem....
Is this possible? For example, I have a class TriangleDataView with an init method. Currently the method is declared like this:
- (id)initWithFrame:(CGRect)frame delegate: (id) delegateObject;
I would like to require that delegateObject conform to the UITextFieldDelegate protocol. But what is the syntax for that?
...
I'm compiling in a local version of the SBJson library into my iPad project. I just started linking in a static .a library that has compiled symbols that collide with objects in the SBJson library. I am able to modify the SBJson library, what is the best way to modify it to avoid the name collisions?
...
Hi all,
I have a drill down navigation app with three levels of UIViewControllers.
In each view controller, I have a UITextField where I am trying to subclass the UIKeyboard for each. My question is where to "set" notifications and "unset" them.
I have the notifications:
[[NSNotificationCenter defaultCenter] addObserver:self selecto...
If I have a class
@interface Foo {
NSString *temp;
}
@property(nonatomic, copy) NSString *temp;
@end
I understand that upon assignment, the old temp will get released and the new one will be assigned using temp = [newTemp copy]. And going by memory management rules, you are supposed to do [temp release] in the dealloc method of...
I am going to use Address Book as my app's data source for use to add new contact or select a contact. The contact is mainly for company or organization, but it can be a person.
For adding a new contact, I would like to show a list of contacts, like people pick control:
However, I cannot figure out to change Cancel to Add, and Groups...
Here's a screenshot of keynote on the ipad:
The toolbar is pretty flat - it doesn't have a vertical gradient the way the builtin toolbar styles do. I've played with the different styles, the translucent flag, and the tint color, and haven't been able to replicate it.
How are they doing this? How would I implement it?
...