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

ios- pdf generation in uiscrollview

in my ios app i am listing out some data in scroll view. When a button is clicked the datas in the page are been generated in pdf file format. Following is the bit of code. – (void)createPDFfromUIView:(UIView*)aView saveToDocumentsWithFileName:(NSString*)aFilename{ // Creates a mutable data object for updating with binary data, like a byte array NSMutableData […]

Displaying iOS iAds only to supported countries

It seems apple serves iAds only to very few number of countries. So I would like to stop sending iAd requests when app is being used in a non-iAd-supported country. So what is the best way to do this? I’m asking this question because I recently received following message from Apple via iAd network’s messages […]

Detect iPhone orientation before loading tableview

So, I’m in a bit of a bind… According to this post, the orientation of the iPhone/iPad is portrait up to a point after which the “auto-rotate” function inside the controller tells iOS that the orientation has changed. My problem is that it appears as though the tableview cells are loading before I have a […]

Apparent memory leak in FastEnumeration when deriving from NSMutableDictionary

I have a class that acts as a subclass of NSMutableDictionary (mostly by delegation) as we have some custom interfaces wrapped around a dictionary. When running the ios leak instrument it is identifying my keyEnumerator method as the source of the leak of NSFastEnumerationEnumerator objects. Here is my keyEnumeration method as a delegate for the […]

method taking mutli arguments in dot notation

i am viewing this video on objective c. the guy show a method which takes multiple arguments and it looks like this – (void) setTo: (int) n over: (int) d { …. } to use it he shows: [myFraction setTo: 100 over:200]; how would that bracket notation look in dot noation? andi dont understand what […]

How to disable default notification alert view on iOS remote notifications?

In my app I enabled remote notifications, if(SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(@”10.0″)){ UNUserNotificationCenter *center = [UNUserNotificationCenter currentNotificationCenter]; center.delegate = self; [center requestAuthorizationWithOptions:(UNAuthorizationOptionSound | UNAuthorizationOptionBadge) completionHandler:^(BOOL granted, NSError * _Nullable error){ if( !error ){ [[UIApplication sharedApplication] registerForRemoteNotifications]; } }]; }else{ UIUserNotificationType userNotificationTypes = (UIUserNotificationTypeAlert | UIUserNotificationTypeBadge | UIUserNotificationTypeSound); UIUserNotificationSettings *settings = [UIUserNotificationSettings settingsForTypes:userNotificationTypes categories:nil]; [application registerUserNotificationSettings:settings]; [application registerForRemoteNotifications]; } And […]

iOS UICollectionView: Cells not showing

I’m missing something obvious here as this isn’t a difficult task. I have my Collection view in storyboard (amongst other views), with the prototype cell’s reuse id being “Cell”, and a UILabel in that cell, with a tag of 100. The code (boilerplate): – (NSInteger)numberOfSectionsInCollectionView:(UICollectionView *)collectionView { return 1; } – (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section { […]

Unwind segue does not release my view controllers

I have something like this: My rootViewController is a navigationBar – let this be A. The rest are normal UIViewControllers, and are programmatically segue via push (through a button IBAction method). However going from D -> A, I use unwind segue (also via performSegueWithIdentifier:sender:). The issue here is that when the segue is performed, B, […]

Convert NSDictionary to std::vector

I want to convert an NSDictionary mapping integers to floating point values into a C++ std::vector where the key from the original NSDictionary is the index into the vector. I have code that I thought would work, but it seems to create a vector larger than the number of key-value pairs in the dictionary. I’m […]

Modify UIDatePicker selection indicator tint color

Is it possible to modify the tint color of a UIDatePicker‘s selection indicator? Or can it be removed so I can add my own selection indicator image? I know in the case of UIPickerView┬┤s you can disable the selection indicator so that you can provide your own selection indicator image.