Skip to content

Instantly share code, notes, and snippets.

@webdevotion
Last active April 8, 2018 01:56
Show Gist options
  • Save webdevotion/5704532 to your computer and use it in GitHub Desktop.
Save webdevotion/5704532 to your computer and use it in GitHub Desktop.
rotation
[self.loadDataButton setBackgroundImage:[[UIImage imageNamed:@"big-button"] resizableImageWithCapInsets:UIEdgeInsetsMake(4.f, 4.f, 4.f, 4.f)]
forState:UIControlStateNormal];
[self.loadDataButton setBackgroundImage:[[UIImage imageNamed:@"big-button-highlighted"] resizableImageWithCapInsets:UIEdgeInsetsMake(4.f, 4.f, 4.f, 4.f)]
forState:UIControlStateHighlighted];
[self.loadDataButton setTitleColor:[UIColor darkGrayColor] forState:UIControlStateNormal];
[self.loadDataButton setTitleColor:[UIColor blackColor] forState:UIControlStateHighlighted];
- (void)configureCell:(UITableViewCell *)cell atIndexPath:(NSIndexPath *) indexPath;
<?php
// include our wordpress functions
// change relative path to find your WP dir
define('WP_USE_THEMES', false);
require('../wp-blog-header.php');
// set header for json mime type
header('HTTP/1.1 200');
header('Content-type: application/json');
// get latest single post
// exclude a category (#5)
query_posts(array(
'posts_per_page' => 10
));
$posts = array();
if (have_posts()) {
while ( have_posts() ) {
$jsonpost = array();
the_post();
// construct our array for json
// apply_filters to content to process shortcodes, etc
$jsonpost["id"] = get_the_ID();
$jsonpost["title"] = get_the_title();
$jsonpost["url"] = apply_filters('the_permalink', get_permalink());
$jsonpost["content"] = apply_filters('the_content', get_the_content("",false));
// would rather do iso 8601, but not supported in gwt (yet)
$jsonpost["date"] = get_the_time('d F Y');
$posts[] = $jsonpost;
}
} else {
// deal with no posts returned
}
// output json to file
echo json_encode($posts);
?>
  • maak de class aan, extend uitableviewcontroller
  • los de warnings op
  • verwijder overbodige comments

toon de titels van de secties

  • (NSString *) tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section;

  • pas een keertje de tableview style aan van de table in de XIB in de interface builder

// Deprecated in iOS6, still needed for iOS5 support.
// ---
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
// Return YES for supported orientations
// return (interfaceOrientation == UIInterfaceOrientationPortrait);
return YES;
}
// iOS6 support
// ---
- (BOOL)shouldAutorotate
{
return YES;
}
-(NSUInteger)supportedInterfaceOrientations{
return UIInterfaceOrientationMaskAll;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment