iOS Development is easy with XCode, Swift3, UITableView, cocatouch, let's build iPhone, iPad and Macbook Applications.

UITextView with text and images combined

I have this UIScrollView with images inside, all the images are 30×30. I also have a a UITextView under the scrollview. What I want to do is to edit the textview, write some text, than to drag the image to the textview, and it will be added after the text (like emoji). How is it […]

CoreData how to detect new version of an app so I can update the model?

I have a very simple model that is created when the app is launched for the very first time and populated with the contents of a plist. I will need to re-create the model again when an update to the app is downloaded and launched. I know that you can version coredata models but I […]

iOS inner query doesn't fetch all objects

I am getting trouble with inner query using. Here is my code. PFQuery *innerQuery = [PFUser query]; [innerQuery whereKey:@”deactive” equalTo:[NSNumber numberWithBool:NO]]; PFQuery *query = [PFQuery queryWithClassName:@”Post”]; [query orderByDescending:@”voteCount”]; [query setLimit:1]; [query whereKey:@”user” matchesQuery:innerQuery]; [query findObjectsInBackgroundWithBlock:^(NSArray objects, NSError error) { //some code }]; Here is a problem. Inner query max limit count is 1000 as […]

Execute a “prepared” math operation in Objective-C

I want to to math operations with some kind of prepared formula that would look like tan(%f)*1000 or %f+%f where the %f has to be replaced by an argument. Is there a function in Objective-C that I can pass the format of my formula and the required numbers to execute this prepared operation? I hope […]

MapView: Use MKUserTrackingBarButtonItem to toggle map tracking state

I have added a MKUserTrackingBarButtonItem to my toolbar. But, clicking it does nothing. So, I assumed I need to use addTarget like a normal UIBarButtonItem but that doesn’t work either. How can I attach a method to that button so that I can change setUserTrackingMode:animated:? MKUserTrackingBarButtonItem *trackingItem = [[[MKUserTrackingBarButtonItem alloc] initWithMapView:mapView] autorelease]; UISegmentedControl *segmentedControl = […]

Strategies for porting Carbon code to Cocoa

I’m looking for strategies and articles on making Carbon code 64-bit ready. Carbon for 64-bit does not and will not exist. It’s pretty much a dead end. So in order to bring Carbon application and toolkits to 64-bit their GUI part will have to be re-written in Cocoa and Objective-C, right? How can I minimize […]

Resizable Centered Circular UIView

I am looking for a way to create a CIRCULAR UIView that is resizable and stays centered (see image). The CIRCULAR view in this example is a UIView subclass WCSDailyGoal. ContainerView.m – (void)createDailyGoalView { _dailyGoalView = [[WCSDailyGoalView alloc] initWithFrame:CGRectMake(0, 0, 200, 200)]; _dailyGoalView.delegate = self; _dailyGoalView.goal = 200; =; [self.view addSubview:_dailyGoalView]; } WCSDailyGoal.m […]

How to animate UIButton background color

I want to change the UIButton background color from black to white color. But I want to change it in animation. For example… black > grey > white. Is there any simple way to do so in iPhone SDK? thank you.

AVAudioSession mixing with AVSpeechUtterance

I have an issue where I would like to have the iPod playing music in the background and in my application I would like to have AVSpeechUtterance lower the volume of the iPod, play a string of text and then I would like to have the iPod resume playing. I have tried several things but […]

Suicide: Objective-C objects calling their own -dealloc methods on themselves

Is it good practice for an object in Objective-C to commit suicide? That is, for an object to declare [self dealloc] where -dealloc permits an orderly wind down as usual? What are the principal risks? As it happens I have a specific example, a custom timer object that extends NSObject and comprises an NSTimer instance […]