Tag: xcode4.2

Take ScreenShot without Window

I’ve been studying Son Of Grab Apple demo and I’m really struggling to get a screenshot of screen without any window (only desktop, dock and menu bar). Does anyone knows how to do so?

Images of UITableView Cells change?

While i finished developing an in-app-purchase application, and after several testing on iPad/Iphone, every thing was fine, the images of table view’s cells and its hight was exactly as wrote in code, so i upload the application, when it was processed to the app Store, i download it, the table view cells in both IPhone/IPad […]

How to dismiss popovers in iOS 5?

I have a PatientTableViewController in the master side of the iPad that has a button for Adding a new patient. It transitions to this NewPatientViewController via a popover segue. In the NewPatientViewController I have a Done button that delegates back to the PatientTableViewController: – (void)newPatientViewController:(NewPatientViewController *)sender withZipCode:(NSNumber *)zipCode andFirstName:(NSString *)firstName andLastName:(NSString *)lastName { [self dismissViewControllerAnimated:YES […]

New XCode Template Equivalents

I’m in the process of learning Objective-C for the iPhone and the biggest hurdle I currently have is that most of the old tutorials aren’t based on ios5. In general that’s fine because I don’t want to use storyboards yet until the adoption of ios5 picks up so the tutorials are fine if I ignore […]

New to Objective-c, Hello World

I am just starting to learn Objective-C programming. I’m developing in Xcode 4.2 on Mac OS X version 10.7.2 on an iMac. I am reading the book “Programming in Objective-C” by Stephen Kochan, which contains a simple “Hello World” example: #import <Foundation/Foundation.h> int main (int argc, const char * argv[]) { NSAutoreleasePool * pool = […]

Hide UITableView when searchResultsTableView displayed

I have a UITableView with a searchDisplayController implemented. I have tableView.backgroundColor = [UIColor clearColor]; and self.searchDisplayController.searchResultsTableview.backgroundColor = [UIColor clearColor]; When I enter text in the search field, the search results are displaying fine, but as the background of the resultant table is transparent, I am seeing my tableview and on the tableview the search result […]

Unable to switch views programmatically using a storyboard?

I am developing a storyboard-based application, using XCode 4.2. I’m new to storyboards, before that I used to switch views by creating a new instance of a class like this: if (x==1) { theClass *theView ; theView= [[theClass alloc] initWithNibName:nil bundle:nil]; [theView setText:theText]; [reader presentModalViewController:theClass animated:YES]; //where reader is an instance of the ZBar library […]

Implementing object mapping using RestKit in Objective-C

I am having trouble mapping a JSON response to objects using RestKit and Objective-C. I have already set up my RKObjectManager and mappings in my AppDelegate as suggested in my previous post by mja. I call my backend in my controller as per the example below. There are two issues I’m having trouble with: [[RKObjectManager […]

How to display video from images

#import “ViewController.h” #import “AVFoundation/AVAssetWriter.h” #import “AVFoundation/AVAssetWriterInput.h” #import “AVFoundation/AVMediaFormat.h” #import “AVFoundation/AVVideoSettings.h” @implementation ViewController – (void)viewDidLoad { [super viewDidLoad]; NSArray *documentDirectories = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); NSString *documentDirectory = [documentDirectories objectAtIndex: 0]; // NSLog(@”Where it is %@ \n”,documentDirectory); image1.image = [UIImage imageNamed:@”images1.jpg”]; CGSize sizeOfImage = image1.image.size; // printf(“Size of Image width = %f height = %f\n”, sizeOfImage.width,sizeOfImage.height); [self […]

NSToolbar: how do I initialise with a selected item?

I have a Mac OS application with a preferences window with a NSToolbar on it. I have also a custom subview under it and other 3 custom views that are loaded inside the first one when the user clicks on one of the options. So far, so good. Now I realised the first item is […]