objective-c

UITableViewCell is 1px shorter in didSelectRowAtIndexPath than cellForRowAtIndexPath

I have a UITableViewCell that I create in tableView:cellForRowAtIndexPath:. In that method I call: UITableViewCell *cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:nil] autorelease]; NSLog(@"Cell height: %f", cell.contentView.frame.size.height); This gives me a return value of 44.000000. Then...

iPhone noob - setting NSMutableDictionary entry inside Singleton?

Yet another iPhone/Objective-C noob question. I'm using a singleton to store app state information. I'm including the singleton in a Utilities class that holds it (and eventually other stuff). This utilities class is in turn included and used from various view controllers, etc. The utilities class is set up like this: // Utilities.h...

How to load JPG file into NSBitmapImageRep?

Objective-C / Cocoa: I need to load the image from a JPG file into a two dimensional array so that I can access each pixel. I am trying (unsuccessfully) to load the image into a NSBitmapImageRep. I have tried several variations on the following two lines of code: NSString *filePath = [NSString stringWithFormat: @"%@%@",@"/Users/adam/D...

UIDEVICE orientation

hello all i have my splash screen which i want to show in landscape mode and all other screen in potrait mode. My root view controller is acting as a splash screen i am writing this code in viewdidload method [[UIDevice currentDevice] setOrientation:UIInterfaceOrientationLandscapeRight]; But this code is not working and shows me tha...

showing custom menu on selection in UIWebView in iphone

I want to show 2 options like "hi" & "bye" when user completes selection on UIWebView. I have added observer to my view controller as follows. But I don't know further implementation. Please guide me. [[UIMenuController sharedMenuController] addObserver:self forKeyPath:UIMenuControllerWillShow...

Dragging in UIWebView

Hi, Is there a way to prevent a UIWebView from being dragged? Also, is there a way to actually overwride the common UIWebView functions such as highlighting? Hope someone can answer me. Thanks ...

Problem in In-App purchase-consumable model

I have created a non-consumable in-app purchase item and now I want to create a consumable in-app purchase item by which a user to buy it every time by using In-App purchase. Now what will have to change in following code in different model:- in InApp purchase manager.m: @implementation InAppPurchaseManager //@synthesize purchasable...

quartz 2d multiple UIViews

I want to create two UIViews in quartz 2D application. First UIView for static text, it will redraw automatically after each one second. Second UIView for animated text, it will be redrawn automatically after each .1 second. How can i create multiple Views/Layers? Is there drawRect methods will be different? ...

TFS build monitor on Mac

I'm planning to create TFS build monitor for Mac on my spare time, are there any TFS libraries available for objective-c or I should use TFS web-services to fetch the information? ...

Shake based application

hi frnz, i am developing an application which deletes rows from a table view when the user shakes the iPhone.i have created a navigation based project. now when the user shakes the iPhone i want that the title of navigation bar should change to "DELETE" and a delete button should appear on the navigation bar on the same view (but th...

what are alternatives to throwing exceptions in objective c

Hi, Google Coding Standard for Objective C says we should not throw exceptions, what are the alternatives to @throw then? ...

iphone app xml based theming

I am creating theme for my app that is xml based and will be stored in a themes folder of my app. I need to traverse that file and apply theme i.e. set navigation bar styles, tabbar styles, fonts etc. What might be best possible solution for doing this? i have got about 7-8 viewcontrollers that needs to be applied that theme on app launc...

When I really need to use [NSThread sleepForTimeInterval:1];

Hi there, I have a program that needs to use sleep. Like really needs to. In lieu of spending ages explaining why, suffice to say that it needs it. Now I'm told to split off my code into a separate thread if it requires sleep so I don't lose interface responsiveness, so I've started learning how to use NSThread. I've created a brand...

Mail Composer Problem with app ondevice method

hello I am using this code for mail MFMailComposeViewController *picker = [[MFMailComposeViewController alloc] init]; picker.mailComposeDelegate = self; NSString *msgTitle = @"Sample Title"; [picker setSubject:msgTitle]; NSArray *toRecipients =[[NSArray alloc] init]; NSArray *ccRecipients =[[NSArray alloc] init]; NSArray *bccRec...

how to terminate cocoa app in applicationWillFinishLaunching delegate

I have to show the custom license Agreement dialog to the user before they start using my application.So, i have added new window in my mainMenu.xib and showing that window modally using [NSApp runModalForWindow:licenseWindow]; in applicationWillFinishLaunching: delegate by making my main window hidden using visible at Launch to unch...

Binding value for NSTableView, but tooltip gets set as well

I've set up an NSTableView in Interface Builder to be populated from an NSArray. Each value of the array represents one row in the table. The value is bound correctly, but as a side effect, the table cell's tooltip is set to the string representation of the bound object. In my case, the NSArray contains NSDictiorany objects and the tool...

How do I get intellisense to pop up?

How do I get intellisense to pop up while I am coding? I know it pops up when I start typing a known type, e.g., if I type NSS it will finish it for me NSString. How do I get it to give me a bunch of options like in Visual Studio, e.g., if I type NS I want to see what my options are like NSString, NSInteger, etc? And if I have not type...

Why should I call self=[super init]

Let's say I create my class and its init method. Why should I call and return value of superclass init assigned to self? Which cases it covers? I would appreciate examples why would I need it for Cocoa superclass and non-Cocoa. ...

Can we categorize photos in photolibrary?

Is there anyway to categorize photos in the photolibrary? I want to make different folders in my photolibrary like Friends,Family,US Trip,...etc. ...

Simple ViewController / View, remove white bar?

I am just looking at setting up a simple viewController programatically, I have a ViewController.xib file that I have set the background color to RED in interface builder. I have also added the following to my AppDelegate.m @implementation syntax_MapViewAppDelegate @synthesize window; -(BOOL)application:(UIApplication *)application did...