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

Delete row from UITableView NSMutableArray and ManagedObjectContext

I’ve got the UITableView which is populated from NSMutableArray. NSMutableArray was created from my NSFetchedResultsController which came from another view Templates *template2 = (Templates *)[fetchedResultsController objectAtIndexPath:indexPath]; qModalView.templateObject = template2; and was recorded to templateObject, so I have got all my objects in this my NSMutablArray that way. [templateObject.questions allObjects]; Now I want to delete row […]

iOS OpenGL using parameters for glTexImage2D to make a UIImage?

I am working through some existing code for a project i am assigned to. I have a successful call to glTexImage2D like this: glTexImage2D(GL_TEXTURE_2D, 0, texture->format, texture->widthTexture, texture->heightTexture, 0, texture->format, texture->type, texture->data); I would like create an image (preferably a CGImage or UIImage) using the variables passed to glTexImage2D, but don’t know if it’s possible. […]

how can i disable user touch of a UIbarbutton without disabling?

i have a UiBarButton item in my Toolbar.i need to deactivate the user touch interaction in UiBarButton. there is no setUserInteractionEnabled property to it. when i am hiding it there is no proper visibility .can any one tell me that how can i disable user touch interaction of a UIbarbutton without disabling it?

Objective-c multiple delegates in the same view – ECSlidingViewController

I started testing ECSlidingViewController and after I tried to access FirstTopViewController I have a big trouble – because in FirstToViewController I already have ZBarReaderDelegate implemented and all examples of delegate are not triggering any method from my delegate. Basically I have this stuff: FirstTopViewController.h #import …MyStuff… #import “UnderRightViewController.h” @interface FirstTopViewController : UIViewController <RightViewDelegate, ZBarReaderDelegate> @property […]

Custom fonts in iOS 8 not showing

When building for iOS 7, my custom fonts are displayed in a UILabel correctly. However building with XCode 6 and for iOS 8 another “standard” font is displayed. Code: UILabel *label = [[UILabel alloc] initWithFrame:rect]; UIFont *font = [[CAPTheme sharedTheme] appTitleFont]; label.text = title; label.textAlignment = NSTextAlignmentCenter; label.textColor = [UIColor whiteColor]; label.backgroundColor = [UIColor clearColor]; […]

MapView add an action to custom annotation (the right arrow)

I create the annotation pins via this for loop: UIButton *eventMore = [UIButton buttonWithType:UIButtonTypeDetailDisclosure]; for (i = 0; i < [results count]; i++) { //NSLog(@”Result: %i = %@”, i, results[i]); //NSLog(@”%@”,[[results objectAtIndex:i] objectForKey:@”long”]); myAnn = [[CustomAnnotation alloc] init]; location.latitude = (double)[[[results objectAtIndex:i] objectForKey:@”lat”] doubleValue]; location.longitude = (double)[[[results objectAtIndex:i] objectForKey:@”long”] doubleValue]; myAnn.coordinate = location; myAnn.title = […]

Best way to add a “forCount” control structure to Objective-C?

Adam Ko has provided a magnificent solution to this question, thanks Adam Ko. BTW if, like me, you love the c preprocessor (the thing that handles #defines), you may not be aware there is a handy thing in XCode: right click on the body of one of your open source files, go down near the […]

Is it good practice to convert return value type from NSMutableArray to NSArray if return type of method is NSArray?

In the following code, I don’t get any warning or compile error if I return NSMutableArray instead of NSArray which is the method’s return type. But is it good practice to convert return value to NSArray by using -copy method like the following code? Or should I return NSMutableArray? +(NSArray *)returnImutableArray { NSMutableArray *arr = […]

Mixing Sprite Kit with Empty Application

I am currently developing an application for the iPhone with the Empty Application default. This means that the only thing created by Xcode is an AppDelegate. The only framework imported in my .pch file is the <Foundation/Foundation.h> Framework. This is working out for most of my application, but in some places, I would like to […]

AVAssetExportSession missing audio track when exporting on device

I run the export on the simulator and everything works great. I run it on the device and the video gets exported but there’s no audio. This leads me to believe that I must be using an audio format that the device doesn’t support but OS X does, as the simulator uses what OS X […]