cocoa-touch

UITableViewCell: Allowing Selective Deletion

I have a table view and want to allow reordering of all cells, however there are certain cells that i do not want to be allowed to be deleted. when the UiTableView is put into deletion mode i do not want the red '-' button to appear on the left hand side, and do not want the swipe gesture to bring up the Delete button of these cells but ...

UIButton only responds in a small area

I'm trying to add a UIButton to a UIView, but am having some trouble with getting it to respond to touches. I have a method which returns UIButtons after I provide it with a tag: - (UIButton*)niceSizeButtonWithTag:(int)tag { UIButton * aButton = [UIButton buttonWithType:UIButtonTypeCustom]; [aButton setTag:tag]; [aButton a...

Predicate for comparing the month component of a Core Data date attribute

I have a Core Data entity which has a date attribute. I would like to write a predicate to extract all dates within a specific month, e.g. July, irrespective of year. How can this be achieved? Thanks ...

Why self.view is not available

I have this code in the main view controller and it is working just fine and as I wanted. loadingActionSheet = [[UIActionSheet alloc] initWithTitle:@"Posting To Twitter..." delegate:nil cancelButtonTitle:@"Cancel" ...

Custom cell and Delete/Move indicators

Hello, I have a custom UITableViewCell. However, when I got in edit mode, I don't have any Delete and Move indicators appearing. The custom cell draws itself in the contentView. In layoutSubviews, I make sure there is space on the left and one the right of the contentView so that the controls can appear (if this was the problem). - (v...

Create new UIImage by adding shadow to existing UIImage

I've taken a look at this question: http://stackoverflow.com/questions/962827/uiimage-shadow But the accepted answer didn't work for me. What I'm trying to do is take a UIImage and add a shadow to it, then return a whole new UIImage, shadow and all. This is what I'm trying: - (UIImage*)imageWithShadow { CGColorSpaceRef colourSpa...

Resize image with blue dots like in copy/Paste Function?

Hello, I want to add a resize function to my app which works like the integrated copy feature on the iPhone. When the user opens the view he should see the image with the four blue dots which enable him to resize it. Is there an available example for this? Or has anyone the keywords for this functionality, which i can use for my further...

Create swipe controlled simple flipbook style animation in ObjC

Hi I am a beginner in Obj C development, though quite experienced (over 10 years) with other ECMAscript based languages and OOP development. I want to build a simple flipbook style animation, controlled through swiping motion. I'm sure extremely simple for any advanced ObjC coders. Can anyone with extensive ObjC-CocoaTouch experience g...

UITabBar without labels (like Tweetie 2/Twitter for iPhone)

I'd like to build an app with a tabbar in the style of Tweetie 2/Twitter for iPhone (that is, images with no labels). I can't see a way to do it with normal UITabBarController/UITabBar, and my current thinking is that it's actually a UIToolbar with a custom view controller that is pushing and popping views from an array to simulate the U...

UITableView - Select nearest row after row deletion.

like build in apple notes app, after you swipe to delete the selected row, it will select the nearest available row automatically. The logic should be: if row count > 0 then if deleted_row == last row then select deleted_row_index-1 row else select deleted_row_index+1 row end end i have try to implement the above log...

There's already an instance of AddressBookSync running. How to resolve this error?

I am deleting contacts from addressbook programmatically. I got error "There's already an instance of AddressBookSync running" on console and my application is not responding. There are 5000 contacts in addressbook. When iSync preferences option "Enable Syncing on this computer" is unchecked then all is working well. But when it is che...

How can you connect an iPhone to a Mac via Bluetooth?

Is is possible for an iPhone application I'm writing to connect to a Mac via Bluetooth? We don't have direct access to the Bluetooth API, so how would I go about doing this? ...

How I auto size a UIScrollView to fit the content.

Is there a way to size a make a UIScrollView auto adujust to the height (or width) of the content it's scrolling? something like: [scrollView setContentSize:(CGSizeMake(320, content.height))]; Thanks ...

UINavigation Controller and UITabBarController toggling

Is it possible to do this? In my appDelegate setup both a UINavigationController and a UITabBarController. Initially my UINavigationController is added to the subview with a root view. In my RootView when the user clicks on a certain button, it will remove the UINavigationController from the subview and will add a UITabBarController w...

How to turn off location services?

If a user has location services on, I assign my RootController as its delegate: appDelegate.clLocationManager.delegate = self; where appDelegate is an instance of my application delegate, which is where I have the location services instance. clLocationManager is an instance of CLLocationManager. If I discover the user is outside of a...

how to add UIActivityIndicator to window as subview..?

Hi, i have to add activity indicator to UITableViewController view since table view height can wary as number of rows increases its not possible to activity indicator display at center. So i think to add it as subview to window and bring it front but when i try [[self view] window] it giving nil, i tried even [[[self view] supe...

XML Parsing need help iphone sdk

Hi all, How do you get "MayurS123" from following xml tag by parsing? <eletitle lnk="http://192.168.10.2/justmeans/trunk/newsfeed/mayurs"&gt;MayurS123 Sharma</eletitle> My file is getting parsed properly. Here I'm able to retrieve the lnk component by doing: if([elementName isEqualToString:@"eletitle"]) { aGoodwork.lnk = [at...

How to resize a UISwitch?

I have made a custom UISwitch (from this post). But the problem is, my custom texts are a bit long. Is there any way to resize the switch? [I tried setBounds, did not work] Edit: Here is the code I used: @interface CustomUISwitch : UISwitch - (void) setLeftLabelText: (NSString *) labelText; - (void) setRightLabelText: (NSString *)...

NSOperation Causing Crash when Passed to Delegate

For an iPhone app, I'm using a NSOperationQueue to limit access to the SQLite database to one query at a time. I created a subclass of NSOperation and in the main function I have the following: - (void)main { // ... other code here ... if( [_delegate respondsToSelector:@selector(queryCompleted:)] ) { [_delegate ...

Memory management & viewDidUnload?

If I have a viewController setup as below: @interface MapViewController : UIViewController <MKMapViewDelegate, CLLocationManagerDelegate> { CLLocationManager *locationManager; } -(void)viewDidLoad { [super viewDidLoad]; locationManager = [[CLLocationManager alloc] init]; } when it comes to memory management should I be ad...