cocoa-touch

Cocoa-Touch: Using UITabBarController with multiple tabs as UINavigationControllers

I'm building an app that has 5ish tabs, each of them will have table + item details views. So I have to create a UITabBarController and the items instead of being the direct views are the UINavigationControllers with a default view inside. I've done this, and it works, but.. Isn't this a waste? Looking at what the UITabBarController d...

Changing subview content after view has loaded (cocoa touch)

Hello, I am trying to create my own implementation of a tab bar, using a toolbar instead of a tabbar (to enable customization of the new "tab bar"). In order to achieve this, I need to have the ability to switch between views when a button is pressed. Currently, my view consists of a tabBar subview, and a customView subview. The latt...

Settings IBOutlets to nil in dealloc

In the section titled 'Memory Warnings' here http://developer.apple.com/iphone/library/documentation/Cocoa/Conceptual/MemoryMgmt/Articles/mmNibObjects.html, I don't follow why the IBOutlet is set to nil in the dealloc. If self.anOutlet = nil causes a crash as mentioned in the topic, why are they setting the ivar to nil? In general, ...

Read NSNumber from NSData

Hi, I pretty new to Objective-C (and C itself) and need to consume a NSData from a HTTP output. I've never really worked with byte arrays or had to worry about little/big endian issues, and have struggled a bit to write the following method to read a NSNumber with a specified length from that NSData. - (NSNumber *)readNumberWithLength:...

How does presentModalViewController interact with nested UITabBarController and UINavigationController

I have a view that I want to take up the full screen, so I override the init method, and some of the view methods: - (id) init { if (self = [super init]) { self.wantsFullScreenLayout = YES; } return self; } - (void) viewWillAppear:(BOOL)animated { [super viewWillAppear:animated]; [[UIApplication sharedApplication] setStatu...

Iphone sequential animation with setAnimationDelay

I'm trying to chain animation events. The application I'm coding for work has a multiple choice quiz. First you pick your multiple choice answer. The quiz view fades away. Then a label ("correct" or "incorrect") fades in and then fades out. Finally the quiz fades back in again. The events are called and handled by a main viewController. ...

On the iphone, how do I add a location to the maps application?

Is there a way to add a location from an MKMapView in my application to the built-in Google Maps app? From what I understand there is probably one of two ways to do it: using [[UIApplication sharedApplication] openURL:xxx] (like opening a web address, writing an email, or dialling a number) or using a C-api like adding a contact to the ...

UIImage view questions

I have a UIImageview in my application and I was wondering how I can show an image in it pragmatically and change it whenever I want to! I think my major problem is exactly WHERE to put it! If you could show me what code and where that would be very usefull! thanks! EDIT: Also if you can pragmatically change the background into an image...

Generate hash from UIImage

I'm trying to compare two UIImages from the file system to see if they are the same. Obviously, I can't use NSObject's hash method, since this returns a hash of the object, and not the actual image data. I found code generate an MD5 hash from a string, but I haven't discovered how to implement it for a UIImage. How should I go about ha...

Am I permitted to change the object graph in NSManagedObjectContextObjectsDidChangeNotification?

I'd like to know when an object has been inserted into my Core Data MOC and when it has, add it to another object with a relationship. So I watch the NSManagedObjectContextObjectsDidChangeNotification notifications find all the objects of the correct class in the set of inserted objects and make the connection using addObject so that t...

Adding UIButton outside of the screen

Hi, I'm creating and adding an UIButton dynamically to UIView, like: UIButton *btn = [UIButton buttonWithType:UIButtonTypeContactAdd]; btn.frame = CGRectMake(100, 10, btn.bounds.size.width, btn.bounds.size.height); [btn addTarget:self action:@selector(myAction:) forControlEvents:UIControlEventTouchUpInside]; [myView addSubview:btn]; ...

Display full Addressbook..

HI guys , How do i display the full addressbook in a tableview...using UITableview and Abaddressbook class.......? ...

how to insert addressbook contacts in tableview

Hi Guys, How do i insert addressbook contacts in a tableview....? i got stuck up with this please help me find out guys..... ...

When to use a UIView vs. a UIViewController on the iPhone?

I have always sort of wondered when to use a UIView vs. a UIViewController on the iPhone. I understand that you shouldn't use a UIViewController unless it's a full-screen view, but what other guidelines are there? For example, I want to build a modal overlay - a screen that will slide into place over the current screen. If this modal o...

NSKeyedUnarchiver causing memory leak

Hi guys! I have a memory leak problem, I'm saving an array into a file using: [NSKeyedArchiver archiveRootObject:myArray toFile:MyFile]; the objects included into the array have the following methods: - (id)initWithCoder:(NSCoder *)coder { [super init]; parameter1 = [[coder decodeObject] retain]; parameter2 = [[coder decodeObject...

How to detect stack objects falling down

Hi to All, In my game, Objects are falling down and I have to catch that object and have to create a stack. I am doing this by using chipmunk physics engine. I am able to create stack but I don't understand how to detect that stack is falling like "Tower Bloxx" game. If any one knows it please help me out. ...

How to add background image on iphone Navigation bar ?

Hi guys ! i want add an image background to my navigation bar like this : what is the code ? thank you ist it right ? //set custom background image UIImageView *backgroundView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"NavigationBackground.png"]]; [self.navigationBar insertSubview:backgroundView atIndex:0]; [back...

How do I prevent a specific view from responding to shake gestures?

Hi. I use shake gesture for my application but i have problem! My application is a multiview application and i want use shake gesture on the view 2. If i active shake gesture on view 2, I have to write the code below in the MainViewController.m and MyView2Controller.m to use the shake gesture. Then if i shake the iphone, alert show on ...

Why isn't my variable being assigned

Ok I think my understanding of properties in objective c may not be what I thought it was. In my program I have a singleton that contains my class. In my class during the init I assign a value from the singleton to my property. I then assign a value to a property of that property. However it does not keep the value and when I do a co...

Refresh MKAnnotationView on a MKMapView

I'd like to a-synchronically load images for my custom MKAnnotationView; I'm already using the EGOImageView-framework (it goes very well with UITableViews), but I fail to make it work on MKMapView. Images seem to be loaded, but I cannot refresh them on the map - [myMap setNeedsDisplay] does nothing. ...