This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@implementation MainWidgetViewController | |
- (NSArray *)getArrayOfRecrodsFrom: (NSArray *)response { | |
NSMutableArray * rows = [[NSMutableArray alloc] init]; | |
if ([response count] != 0) { | |
// 1. get all NSDictionary keys | |
NSDictionary * temp = response[0]; | |
NSArray * keys = [temp allKeys]; | |
if (!NSClassFromString(self.ServiceName)) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@implementation MainWidgetViewController | |
- (NSArray *)getArrayOfRecrodsFrom: (NSArray *)response { | |
NSMutableArray * rows = [[NSMutableArray alloc] init]; | |
if ([response count] != 0) { | |
// 1. get all NSDictionary keys | |
NSDictionary * temp = response[0]; | |
NSArray * keys = [temp allKeys]; | |
if (!NSClassFromString(self.ServiceName)) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
unsigned propertyCount = 0; | |
// replace BanksModel with the class name you want to find out its attributes | |
objc_property_t *properties = class_copyPropertyList([BanksModel class], &propertyCount); | |
for (int prop = 0; prop < propertyCount; prop++) { | |
// for all property attributes | |
unsigned int attributeCount = 0; | |
objc_property_attribute_t * attributes = property_copyAttributeList(properties[prop], &attributeCount); | |
for (unsigned int attr = 0; attr < attributeCount; attr++) { | |
NSLog(@"Attribute %d: name: %s, value: %s", attr, attributes[attr].name, attributes[attr].value); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (NSArray *)getRecrodsFromDictionary: (NSDictionary*)dictionary { | |
// the following include the array that I want to turn into objects | |
NSArray * response = [self parseKey:@"responseDetails" fromDictionary:dictionary]; | |
NSMutableArray * rows = [[NSMutableArray alloc] init]; | |
if ([response count] != 0) { | |
// 1. get all NSDictionary keys | |
NSDictionary * temp = response[0]; | |
NSArray * keys = [temp allKeys]; | |
// 2. create a class |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$client_id = 'xxxxxxxx'; | |
$file = file_get_contents("test-image.png"); | |
$url = 'https://api.imgur.com/3/image.json'; | |
$headers = array("Authorization: Client-ID $client_id"); | |
$pvars = array('image' => base64_encode($file)); | |
$curl = curl_init(); | |
curl_setopt_array($curl, array( | |
CURLOPT_URL=> $url, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class Crypt { | |
private $key; | |
function __construct($key){ | |
$this->setKey($key); | |
} |
NewerOlder