cocoa-touch

Rotating and Moving a UIImageView (CocoaTouch)

This code works to rotate: CGAffineTransform transform = CGAffineTransformMakeRotation(radians(lastAngle++)); anImage.transform = transform; and this code works to move my UIImageView CGRect frame = [anImage frame]; frame.origin.x+=1; frame.origin.y+=1; [anImage setFrame:frame]; but when I combine them, the image str...

How can I launch QuickTime from my app?

I am trying to load a video from the web, but am having trouble getting it to appear in QuickTime. I can only hear the audio. I would like it to launch QuickTime. - (void)loadView { NSURL *movieURL = [NSURL URLWithString:@"http://movies.apple.com/media/us/mac/getamac/2009/apple-mvp-biohazard_suit-us-20090419_480x272.mov"]; if ...

iPhone: Infinitely looping content inside UIScrollView

In my app, I'm designing a custom picker that allows the user to choose an item by scrolling horizontally and touching it. I need the buttons inside that view to loop around infinitely as the user scrolls in a certain direction. What would be the best way to tackle this feature while maintaining the inertial scrolling of UIScrollView whe...

How can I temporarily put a toolbar on top of the tab bar (without pushing a new view)?

I have a UITableViewController inside a navigationController inside a tabBarController; so far, so good. However, when the user clicks on a button on the navigation bar (at the top), I want to display a toolbar at the bottom of the screen with various actions that can be performed on the table. When I define an NSArray *toolbarItems and ...

Problems with CGPoint/touches event

I'm having some problems with storing variables from my touch events. The warning I get when I run this is that coord and icoord are unused, but I used them in the viewDidLoad implementation, is there a reason why this does not work? Any suggestions? #import "iGameViewController.h" @implementation iGameViewController @synthesize pla...

Root view controllers and modal dialogs

In a custom UIViewController, if I have a member UINavigationController that I initialize with self as the root view, like this: navController = [[UINavigationController alloc] initWithRootViewController:self]; then presenting a modal dialog does not hide the tab bar at the bottom of the screen. The result is that if the user switches...

Application crashing in the iPad but working fine in iPad simulator.

Hi, I am writing a game in cocos2d. In the iPad Simulator the application is running good. While I am running the application in the iPad. But it was crashing by giving the following message in terminal. I am using 2048x2048 CCSpriteSheets in my code. I used instruments tool there is sudden increase in memory to 32MB before crashing. I...

UIView Animation won't run transition

So, I've searched quite a bit for this and can't seem to find a solution. This code works: CGContextRef context = UIGraphicsGetCurrentContext(); [UIView beginAnimations:nil context:context]; [UIView setAnimationDuration:5]; [c setCenter:CGPointMake(200, 200)]; [UIView commitAnimations]; This code doesn't: CGContextRef context = UIGr...

Why doesn't this UIButton show its text label?

Everything about this UIButton renders great except the text that's supposed to be on it. NSLog demonstrates that the text is in the right place. What gives? UIButton *newTagButton = [UIButton buttonWithType:UIButtonTypeRoundedRect]; [newTagButton addTarget:self action:@selector(showNewTagField) forControlEvents:UIControlEventTouchUpIns...

iOS Question. Is There a Framework for Build Time Based Apps.

I have the need for some time based effects in the iPad app I am building. The UIView class animation capability beginAnimations/commitAnimations is exactly the sort of thing I am looking for but it is restricted to specific properties of UIView deemed animatable. Ideally, I am looking for a solution that lets me drive a time-based func...

How to convert NSDate into Unix timestamp in Objective C/iPhone?

How can I convert an NSDate to a Unix timestamp in Objective-C? ...

Do you know of any Key-Value-Coding and Key-Value-Observing session videos on the net?

I know Apple is not the only ressource out there, and many people create great videos in conferences and presentations. If someone knows a great video or podcast on the topics KVC or KVO, please let me know. I would be glad about it! Edit: Changed Title so it's more clear this is indeed programming related. KVO / KVC / MVC != KFC ...

Are there more Cocoa and Cocoa Touch videos which are worth looking at?

To gain a better understanding, I think it would be great to watch every video available on the net. For me, training videos became sort of entertaining. I love them! And at the same time, it's the most productive form of "watching movies". Unfortunately, I tend to find videos from conferences or podcasts only by accident, so maybe you ...

How to Determine if a Table Contains Any Records with Core Data?

I haven't seen any other questions quite like this on here, but I'm hoping someone has some insight. I'm just starting to learn Core Data. Basically, I have two methods and I want to choose which one to call with an if/else statement based on whether or not the "Contacts" table contains any records. Is there a way using core data to che...

UITableView landscape scrolling issue

A little background: My app is designed as a web form in a UITableView. It is similar in format to the iPhone's Settings > Mail,Contacts,Calendars > "Account Name" > Account Info. A few differences: 1) I have a big text box on the bottom where you can put a "message body". 2) I have a big red button underneath the text box, similar to...

View outlet not set with UINavigationController

I have a NIB that contains a UINavigationController which has a UIViewController. The UIViewController is being loaded externally from another nib. I am unable to set the view property thus I get the error: *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: '-[UIViewController _loadViewFromNibNamed...

Loading an external NIB, how do I set the view property?

If I am loading a view from another NIB, how do I set the File's Owner view property? IB is not letting me hook it up to my View Controller which is loading the external NIB. My NIB looks like this: File's Owner - Identity is set to LBRootViewController First Responder LBTableViewController - Identity is set to LBTableViewController,...

Cocoa & Cocoa Touch. How do I create an NSData object from a plain ole pointer?

I have malloc'd a whole mess of data in an NSOperation instance. I have a pointer: data = malloc(humungous_amounts_of_god_knows_what); uint8_t* data; How do I package this up as an NSData instance and return it to the main thread? I am assuming that after conversion to an NSData instance I can simply call: free(data); Yes? Also, b...

Application Design in Interface Builder Challenge

I want to design an app that launches other sub-apps. Main View will contain 4 buttons. Clicking on each button respectively will launch the other sub-apps. Each sub-app will have a UITabBarController which has its own different views. At any point I want the user to be able to go back to the Main View from any of the sub-apps. I am n...

Converting RGB values to CMYK

Hi all, I have RGB values that I need to convert into CMYK values. I'm using the iPhone SDK to try and do this. I have tried a couple of things, but cannot either get the values to be anything other than 0 or 1, or the K element is completely wrong (showing up as a negative number). Any help would be a life saver! Thanks in advance! ...