Tag: iphone

self.tabBarController is NULL

I created a UITabBarController like the following and pushed a navigationController, but I now cannot set the title of tab bar items etc… as the tabbarcontroller is NULL. Please can you tell me where I am going wrong. UITabBarController *tabBarController = [[UITabBarController alloc] init]; LoggedInFeedNavigationController *lvc = [[LoggedInFeedNavigationController alloc] initWithAccount:account]; [tabBarController setViewControllers:[NSArray arrayWithObject:lvc]]; [tabBarController setSelectedIndex:0]; […]

UITableView cell are overlapping

I’m implementing a tableView with section index. where my tableViewCells are overlapping whenever the rows are more than one in any particular section. Here is my code. ![- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { return \[self.keys count\]; } – (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section { // return \[\[\[UILocalizedIndexedCollation currentCollation\] sectionTitles\] objectAtIndex:section\]; return \[keys objectAtIndex:section\]; } – (NSArray *)sectionIndexTitlesForTableView:(UITableView *)tableView […]

Can I stop a UITableViewCell from shrinking when I enter edit mode?

When you enter edit mode for a UITableView (grouped but I believe this applies for the other types as well), the cells shrink to the right to accommodate the delete selection buttons. For cells that I dont wish to add/insert/delete any content, is there anyway to stop this behavior? ie. the width remains fixed. I’ve […]

How to merge two NSArray

I would know how to merge two array which contain some duplicate : Here is an exemple to illustrate what I want to do : // Here is some dictionary which contain an unique “id” key. NSDictionary *dico1 = [NSDictionary dictionaryWithObjectsAndKeys: @”11111111″, @”id”, nil]; NSDictionary *dico2 = [NSDictionary dictionaryWithObjectsAndKeys: @”22222222″, @”id”, nil]; NSDictionary *dico3 = […]

iOS Divide audio from URL into frames

I am working on a simple internet radio app in iOS with a very simple speech/music discrimination. The main idea is a radio which plays a signal from url and at the same time it checks what type of signal is being broadcast. When it detects a speech it change the channel and so on. […]

How to do a semi-transparent modal segue like “Whatsapp” – “Take Photo/ Choose Existing Photo”

My idea is to create a semi-transparent view like whatsapp does. 1) I have a tap gesture on image view. 2) When I tap on the image view, one layer of transparent view like whatsapp will appear 3) I then have three button – take new, choose existing or cancel. How do I continue from […]

How to programmatically dismiss system dialogs like “<App> would like to access your photos”?

Is there a way to programmatically dismiss dialogs like the ones where the app wants to access photos, access contacts and access location? I think there’s a way by swizzling API methods, but I don’t really know which. What is the methodology to find out which methods need to be swizzled? If swizzling is not […]

Preprocessor-IF doesn't work

I’m trying to check with Preprocessor-Ifs if the Device is an iPad. If it is an iPad, I want to define something Devicespecific, but for some reason I can’t check in an PP-IF if a PP-Constant is true. Maybe you got an idea? #ifdef UI_USER_INTERFACE_IDIOM #define IS_IPAD (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) #else #define IS_IPAD false #endif […]

NSMutableDictionary does not get added into NSMutableArray

I am unable to populate the previewData NSMutableArray with this code. XML request is successfully retrieved, parsed but I am unable to populate the previewData array for tableviewController. PreviewsController.h code: #import <UIKit/UIKit.h> @interface PreviewsController : UIViewController <UITableViewDelegate, UITableViewDataSource> { UITableView *previewList; NSString *enteredUsername; NSString *enteredPassword; NSMutableString *current_xml_element; NSMutableString *current_xml_value; NSMutableDictionary *item; NSMutableArray *previewData; } @property […]

Why is showing a UIAlertView in application:didFinishLaunchingWithOptions: causing an error?

On the first run of my application I show an alert view to the user to choose iCloud or local document storage. Showing the alert view causes the following error: Applications are expected to have a root view controller at the end of application launch wait_fences: failed to receive reply: 10004003 Why is this happening? […]