objective-c

How should i remove a tabbaritem from in TabbarController?

Hi, How should i remove a tabbarItem from UITabbar Controller, When i try do this, the whole tabbar removed instead of single tabbarItem remove? Sri ...

maintaining selection in UISegmentedControl

Can i maintain the selected state of UISegmentViewControl segments?? i.e can keep a segment appear selected even if the user selects another segment?? I dont seem to find anything that does this anywhere!! ...

How to use local dictionary to my app?

Hi, In My application, how should i find meaning of the word, it should work both online and offline? Please help me out also is there any possiblilite to take local dictionary from iphone? Sri ...

Not getting the responce in the Device.

Hi all, I am implementing a location based application that which can give you the results of the nearest cofeeshops. For this I am using the google api, i.e http://www.google.com/uds/GlocalSearch?key=notsupplied&v=1.0&rsz=large&sll=17.500166,78.394496&sspn=0.020472,0.021458&q=Coffeeshops%0A&lssrc=gb2&lscst...

Objective C: SHA1

Hi, How do i sha1 a string or set of numbers in Objective c? ...

Core Data entity lifecycle? When are they released?

I am importing a bunch of data from a web service on a background thread and I randomly run into bad access problems, I believe mostly from assigning relationships. I am wondering how long the new entities I create and save hang around? ...

Proper construction of NSFastEnumeration class

I am definitely a beginner when it comes to Objective-C! Any help would be hugely appreciated. This code works for me, but I really feel like it will certainly blow up on me in the future. For example, what if someone calls autorelease drain in the middle of a for loop. Also, what the heck is the difference between itemPtr and stackbuf?...

Division is not working

Hello. I've got a variable: int Result = 42 % 84; However its returning null on NSLog? ...

NSMutableDictionary may not respond to '-setValue:forKey:'

Getting "NSMutableDictionary may not respond to '-setValue:forKey:'" error from this code: NSMutableDictionary *parameters = [[[NSMutableDictionary alloc] init] autorelease]; MKFacebookRequest *request = [MKFacebookRequest requestWithDelegate:self]; //set up parameters for request [parameters setValue:[NSArray arrayWithObjects:[fbConne...

UITableViewController init method not called

I've created an iPad application with a UITableViewController in the UISplitViewController (and everything works :) Since I'd like the table to use UITableViewStyleGrouped, i added: - (id)init { self = [super initWithStyle:UITableViewStyleGrouped]; if (self != nil) { // Initialisation code } return self; } to ...

Cocoa: detect unmountable volume

I folks, I am developing a small app which should be able to unmount volumes. Currently, I am using the following code to determine whether a volume is unmountable or not: BOOL isRemovable, isWritable, isUnmountable; NSString *description, *type; BOOL succ = [ws getFileSystemInfoForPath:[itemInfo objectForKey:@"path"] ...

DetailView empty on first click from UITableView

So I have a working diary app but with one problem. The UIViewTable is populated by Core Data and everything is good. But when I choose a row for the first time and open the detailView it is empty, if I back up and click again it is populated with Core Data info. I have narrowed the problem down to one method in RootViewController and t...

NSPanel transform using NSAffineTransform

This is a rather simple question and I'm sure it's not to hard, but the question is... I have a NSpanel that is centered and then after the centering I need to do a transform to move the window down on the Y coordinate while maintaining the centered X coordinate. Is NSAffineTransform the correct way to go about this and does anyone hav...

How to implement a common base view for iPhone ?

All of my application's pages share the same layout and a set of UI elements, which I've been trying to make a reusable component out of. I've gone the subclassing road, making an "abstract" subclass of UIViewController to hold the base logic for navigation, and a nib file laying out the UI. I've spent some time unit-testing the base c...

How to access the "Custom Content View" of a UINavigationController

Hello all, I have an app that uses a UINavigationController to control its flow, and I want to be able to dynamically swap views into and out of one of the pages in my app. The UINavigationController Reference from Apple's Docs shows this diagram outlining the structure of a UINavigationController. So my question is this: from within...

Objective-C XML Parsing

Hi, I'm using this code to parse XML in the instance variable response: @implementation Delegate - (void)applicationDidFinishLaunching:(NSNotification *)aNotification { MKFacebook *fbConnection = [[MKFacebook facebookWithAPIKey:@"----" delegate:self] retain]; [fbConnection login]; NSMutableDictionary *parameters = [[[NSMutableDictio...

Why "error: expected specifier-qualifier-list before 'UITextView'" (but not for other view types!)

A question about specifier-qualifier-list has already been (asked) and answered but none of the anwsers given solve my problem. My code is simple: #import <UIKit/UIKit.h> @interface TableCellWithTextView: UITableViewCell { @private UITextView *theTextView; } @property (nonatomic, retain) UITextView *theTextView; @end But ...

Using Core Data as a model when not all objects will be stored

Hello, I'm working on an iPhone application that downloads data from a web server and I sometimes, but not always, want to cache the results of these downloads. The entity I'm dealing with is an Event. Events appear in the UI in the following ways: as the result of a location-based search as the result of a keyword-based search a list...

Objective-C can't assign a NSInteger to an NSInteger variable!?

Hey everyone, This is going to seem like a really silly question but I can't figure out why I'm getting an error. I have an instance variable declared as: NSInteger *scopeSelected; I'm using this variable to keep track of what scope has been selected in a UISearchDisplay controller using: - (BOOL)searchDisplayController:(UISearchDi...

Force clockwise/anticlockwise rotation for a CABasicAnimation of a UIImageView

I'm animating a pendulum which swings from 0 degrees to max 200 degrees and then back again. The problem is that if the pendulum goes over 180 degrees, it returns to 0 by the shortest route which is to continue clockwise. And I'd like it to go anticlockwise. Here's my code: ('right' is a boolean which is TRUE when the pendulum is swingin...