view · edit · sidebar · attach · print · history

20130819-update-generikacc-app-view-layout

|Index|>>


Summary

  • Update indicator view
  • Check view layouts for iPad/iPhone 4/iPhone 5 retina on iOS6/7
  • Fix problem in action sheet methods.
  • Create searchbar with NSPredicate.

Commits / Patches

Index / Status


Update indicator

Add callback for after rotation.
Use Notification like this:

in viewDidLoad

 [[UIDevice currentDevice] beginGeneratingDeviceOrientationNotifications];
  [[NSNotificationCenter defaultCenter] addObserver:self
                                           selector:@selector(didRotate:)
                                               name:UIDeviceOrientationDidChangeNotification object:nil];

Then I used CGPointCenter instead of frame origin.x and origin.y for CGRectMake.

commit

links


Update action sheet methods

Check this warning.

2013-08-19 12:03:18.817 generika[99638:c07] Presenting action sheet clipped by its superview. \
Some controls might not respond to touches. On iPhone try -[UIActionSheet showFromTabBar:] or -[UIActionSheet showFromToolbar:] \
instead of -[UIActionSheet showInView:].

Then, I removed unused toolbar from current webview.

commit

link


Create product search

use NSPredicate for mathch (instead of compare) like this:

How to use key and value in NSPredicate

- (void)filterContentForSearchText:(NSString *)searchText scope:(NSString *)scope
{
  [self.filtered removeAllObjects];
  NSPredicate *predicate = [NSPredicate predicateWithFormat:@"%K contains[cd] %@", @"name", searchText];
  self.filtered = [NSMutableArray arrayWithArray:[self.products filteredArrayUsingPredicate:predicate]];
}
commit

link

view · edit · sidebar · attach · print · history
Page last modified on August 19, 2013, at 09:57 AM