How do I store this object in my iOS class? - ios

I am creating my first Master-Detail application for iOS.
I want to store the following
Name
Web URL
In my UITableView, I plan on displaying only the name (sorted) but when the name is tapped, another view will load with a button that will launch Safari with the WebURL
I tried using an MSMutableArray but discovered it's not sortable. Same is true with an NSDictionary.
Any ideas (or sample or links to samples) would be appreciated
I am trying to use methods that are not deprecated in iOS 7.0
and plan on supporting iOS 6
earlier versions are a + but I can live without support for 3,4,5.

An NSMutableArray with an NSDictionary for each item is perfectly fine. You can sort it.
NSMutableArray *rows = #[].mutableCopy;
[rows addObject:#{#"name": #"Bob", #"url": [NSURL URLWithString:#"http://bob.com"]}];
[rows addObject:#{#"name": #"Alice", #"url": [NSURL URLWithString:#"http://alice.net"]}];
NSLog(#"%#", rows);
[rows sortUsingComparator:^NSComparisonResult(id obj1, id obj2) {
return [[obj1 valueForKey:#"name"] compare:[obj2 valueForKey:#"name"] options:NSNumericSearch];
}];
NSLog(#"%#", rows);
Output:
2013-07-20 00:33:31.682 MyApp[28496:303] (
{
name = Bob;
url = "http://bob.com";
},
{
name = Alice;
url = "http://alice.net";
}
)
2013-07-20 00:33:31.682 MyApp[28496:303] (
{
name = Alice;
url = "http://alice.net";
},
{
name = Bob;
url = "http://bob.com";
}
)

You can sort NSArrays, you just have to write the comparison function yourself because NSArrays store objects, and how to you sort objects that contain potentially thousands of values. There is a good post about it here. That should hopefully get the job done.
How to sort an NSMutableArray with custom objects in it?

Related

IOS: getting the value of "id" along with an item is selected through table view

In my project i get response data in the form of
{
"procedures": [5950]
0: {
"Procedures": {
"id": "1"
"procedure_name": "3d render w/o postprocess"
"procedure_code": "76376"
}
}
1: {
"Procedures": {
"id": "2"
"procedure_name": "3d rendering w/postprocess"
"procedure_code": "76377"
}
there are 5950 elements in the data array. i create separate arrays for "id" and "Procedure_name" and show data in UITableView it displays correct data with id.
I also applied search functionality to filter data as it is so difficult to find any element in 5950 elements by scrolling.
search function is also works well but when i select any UITableViewCell of the filtered result it doesn't provide the actual id of that element whereas it returns the current indexpath value of the UITableView.
for searching i put the following code
- (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string
{
tempArray = [NSArray arrayWithArray:dataArray];
NSString *stringToSearch = textField.text;
NSPredicate *predicate = [NSPredicate predicateWithFormat:#"SELF BEGINSWITH[c] %#",stringToSearch]; // if you need case sensitive search avoid '[c]' in the predicate
NSArray *tempresults = [dataArray filteredArrayUsingPredicate:predicate];
if (tempresults.count > 0)
{
tempArray = [NSArray arrayWithArray:tempresults];
}
[searchdiagtable reloadData];
return YES;
}
in DidSelectRow method i apply the following code
if (tableView == searchdiagtable)
{
UITableViewCell *selectedCell = [searchdiagtable cellForRowAtIndexPath:indexPath];
NSLog(#"%#", selectedCell.textLabel.text);
searchdiag. text = selectedCell.textLabel.text;
searchResultId = [iddict objectAtIndex:indexPath.row]; // iddict is the array where i store the values of "id" from dictionary.
[searchdiagtable deselectRowAtIndexPath:indexPath animated:YES];
searchdiagtable.hidden = YES;
}
checking on your question which I can get is issue must be using a wrong array iddict for search as it looks to me its should be tempArray
searchResultId = [iddict objectAtIndex:indexPath.row];
This line of code creates the problem, tableView reuses cells.
if you selected the cell , it selects the cell index (0, 1, 2 ... etc). So your array returns the first values.
If you are not displaying the "Id" in your table view. You cant get correct id from your array.
There is one solution for this,save id and name in a single dictionary,
like:{
"id":"name"
}
using the name you can get the id from dictionary.
hey you already get two arrays , one for ids and one for names.
How you do that..after response may be you did like this
NSMutableArray *id;
NSMutableArray *name;
for( ------ ){
[id addObject:[dict objectforkey:#"id"];
[name addObjec:[dict objectForKey:#"procedure_name"];
}
dict is reponse dictionary.
This is the way how you get arrays.now for dictionary
NSMutableDictionary *dict1 = [[NSMutableDictionary alloc]init];
for(){
[dict setObject:[dict objectforkey:#"id"] forKey:[dict objectForKey:#"procedure_name"];
}
just check the for loop carefully in your code..
i just get an easy way to create A:B type dictionary
i am sharing my code i used and works perfectly for me
NSDictionary * searchdict = [NSDictionary dictionaryWithObjects:dataArray forKeys:iddict];
NSLog(#"dict formed by combining %#",searchdict);
where dataarray and iddict are two arrays
it gives output dictionary as
1034 = "Catheterize for urine spec";
1035 = "Cauterization of cervix";
1036 = "CBC without platelet";
1037 = "CBC/diffwbc w/o platelet";
1038 = "Cbt 1st hour";
1039 = "Cbt each addl hour";
104 = "Amino acids quan 6 or more";
1040 = "Ccp antibody"; ......
yaa, I know we can directly add two arrays to dictionary. But it takes memory for two arrays and dictionary also.. so instead of creating two arrays.you can directly add it to dictionary. But what you did is also correct. In mobile applications every time we have to think about memory management also..

NSMutableArray adds same NSDictionary multiple times

I am looping through an array, getting two items and putting them in a dictionary, and then add them to an array, but it keeps adding the last item of the array for the number objects in the array, even though when I log the dictionary inside the loop it has the correct value. Here is my code
for (TFHppleElement *element in nodesArray) {
[nameAndHrefDict setObject:[element objectForKey:#"href"] forKey:#"href"];
[nameAndHrefDict setObject:[element text] forKey:#"name"];
NSLog(#"PRE: %#", nameAndHrefDict);
[arrayOfDicts addObject:nameAndHrefDict];
NSLog(#"IN: %#", arrayOfDicts);
}
In the log I see this
PRE: {
href = "/dining-choices/res/index.html";
name = "Commons Dining Hall";
}
IN: (
{
href = "/dining-choices/res/index.html";
name = "Commons Dining Hall";
}
PRE: {
href = "/dining-choices/res/sage.html";
name = "Russell Sage Dining Hall";
}
IN: (
{
href = "/dining-choices/res/sage.html";
name = "Russell Sage Dining Hall";
},
{
href = "/dining-choices/res/sage.html";
name = "Russell Sage Dining Hall";
}
)
What is happening?
But it add the last value of nodesArray 8 times, instead of each value, why?
Thanks for the help in advance.
Please try:
for (TFHppleElement *element in nodesArray) {
[arrayOfDicts addObject:[NSDictionary dictionaryWithObjectsAndKeys:[element objectForKey:#"href"], #"href", [element text], #"name", nil]];
}
Objects are added to arrays by reference. The array doesn't create a copy of the dictionary, it just keeps a record of which dictionary has been added. You're adding the same dictionary, nameAndHrefDict, to the array every time. So the array considers itself to hold the same object multiple times.
At each iteration you are changing the value of that object but it is still the same object.
So the underlying issue is identify versus value. An array is populated by identity. You're expecting it to populate by value.
To fix: copy the dictionary when you add it to the array, or just create a brand new dictionary from scratch each time.
You need to alloc and init the array each time, so that there is new memory for it and then it wont add the same array 8 times
You have to instantiate the dictionary in the loop : see the code
NSMutableArray *saveData = [[NSMutableArray alloc]init];
for (int i=0; i<records.count; i++) {
RecordTable *record = [records objectAtIndex:i];
NSString *addID = record.addr_id;
NSMutableDictionary *saveToDic = [[NSMutableDictionary alloc]init];
[saveToDic setValue:addID forKey:#"addr_id"];
[saveData addObject:saveToDic];
}

Need to create a custom view like ABPeoplePickerNavigationController

I want to create a custom view that is just like contacts in iPhone. Is there any tutorial available to make a custom view just like ABPeoplePickerNavigationController?
Please note that I do not want to open the default people picker controller provided by AddressBookUI framework. Also, I do want to bind this navigation controller into my main view.
For reference that what I exactly want, You can refer contacts tab of Whatsapp on iOS device.
EDIT: I already got a contact list and displayed the first and last name of person in a table view. Now, I want to create an index for alphabets from A-Z and on tapping of that index, the table view should scroll to that contacts. Also, How can I implement search functionality to find user by his / her first or last name?
I have the exact same thing in the app i'm currently building and we also got our inspiration from apps like Whatsapp when it came to contacts.
I used a simple tableview with custom cells for visuals, with simply name & picture.
My process was the following :
Create a contact object in coredata (or another persistent way of keeping your data)
Through the ABAddressbook framework you can browse all your contacts and transform them in your new Contact objets. Keep a reference of your ABPerson in your Contact object, this will allow you to find-and-update your Contacts later just using references. If you don't do that you will have to browse to all your ABPersons every time you want to update your Contacts.
You could use the ABPersons directly but it would just be really painful to code.
Once you've extracted all your contacts, make sure to save your context if you use core data, or store them in .sqlite.
You can then simply extract them in an array of Contacts and display those in a custom cell of your choosing.
This appcoda tutorial is a decent custom cell for tableview tutorial. You can find a thousand more just by googling " tableview custom cell ios" and finding different things that you might like. In the end, you'll just have a cell with a label and a picture, you COULD use the simple UITableViewCell which I used for another tableview of "contact" type.
Keeping that contact list up to date (getting the right numbers, pictures, names, etc) and making sure they exist before updating, checking if a contact has been deleted, added, etc. All that has to be done in order for your list to be accurate, and it's a pretty long/annoying process.
I could share my Contact class but it includes a lot of irrelevant code for you which might confuse you because :
- I'm also checking if those contacts are already users of my app to move them in specific sections of my tableview
- I split my tableview in 27 sections (users, then alphabet letters).
Also, and I'll stop it with that last piece of general programming advice : It would be a good idea to write down first exactly what you need and what you'll need, get all the possibilities on paper, etc. I bumped into a lot of simple problems that it took me a while to resolve, either because I didn't plan properly or because it was hidden.
For example :
Some of your contacts don't have names, at all.
Some of your contacts have a name in the "Title" field (where you write Doctor, or Mister)
Some of your contacts don't have phone numbers (if you're using phone numbers as identifiers)
Some of your contacts have international formatting and some not (+32 46556555 or 0032 46556555)
Some of your contacts have pictures taken with camera, some others from Gmail, which have different formats
You might have duplicate contacts (same name, same everything) due to poor sync from the user
You need to make sure the firstname/lastname is in the right section, case sensitive coding can cause trouble
You need to find a solution for a contact that start with a smiley or non alphanumeric characters
Your users will want an index-list on the side
Of course you'll need to add a search bar because, some people have way more than 1000 contacts.
Many more to come, I guarantee that.
Because this is very app-specific i'm not gonna go over every problem that I had and what I did for it, but you get the idea :) Feel free to ask any very specific questions though and I might already have a very specific solution, since I pretty much had to copy whatsapp's contacts from scratch and, hell, I made it. (I actually got the exact same as Anonymess and iOS)
EDIT : Here are some methods of my ABPerson extracting methods ; the ContactDAO mostly interact with my persistent model (CoreData) and I believe their names are clear enough for you to understand what's happening. I'm kind of happy with the comments and variablenames so you should be to read that without too much trouble.
Here comes a massive block of code.
- (NSMutableArray *)getAllRecordsWithPeople:(CFArrayRef)allPeople andAddressBook:(ABAddressBookRef)addressbook{
NSMutableArray *newRecords = [[NSMutableArray alloc]init];
CFIndex nPeople = ABAddressBookGetPersonCount(addressbook);
for (int i=0;i < nPeople;i++){
ABRecordRef ref = CFArrayGetValueAtIndex(allPeople,i);
ABRecordID refId = ABRecordGetRecordID(ref);
NSNumber *recId = [NSNumber numberWithInt:refId];
[newRecords addObject:recId];
}
return newRecords;
}
- (void)getValidContactsFromAddressBookWithCompletionBlock:(void (^)(NSError *error))completion{
ABAddressBookRef addressBook = ABAddressBookCreateWithOptions(NULL, nil);
__block BOOL accessGranted = NO;
if (&ABAddressBookRequestAccessWithCompletion != NULL) {
dispatch_semaphore_t semaphore = dispatch_semaphore_create(0);
ABAddressBookRequestAccessWithCompletion(addressBook, ^(bool granted, CFErrorRef error) {
accessGranted = granted;
dispatch_semaphore_signal(semaphore);
});
dispatch_semaphore_wait(semaphore, DISPATCH_TIME_FOREVER);
}
if (accessGranted) {
NSMutableArray *newRecords = [[NSMutableArray alloc]init];
NSMutableArray *updatedRecords = [[NSMutableArray alloc]init];
NSMutableArray *unchangedRecords = [[NSMutableArray alloc]init];
CFArrayRef allPeople = ABAddressBookCopyArrayOfAllPeople(addressBook);
CFIndex nPeople = ABAddressBookGetPersonCount(addressBook);
//Checking the last time we updated
NSTimeInterval lastSyncTime;
if ([[NSUserDefaults standardUserDefaults]objectForKey:#"LastSyncTime"] == nil){
//This is the first time we update.
lastSyncTime = 0;
}else{
//Setting the last update in variable
lastSyncTime = [[[NSUserDefaults standardUserDefaults]objectForKey:#"LastSyncTime"]doubleValue];
}
if (lastSyncTime == 0){
//We have to insert everyone, this is the first time we do this.
newRecords = [self getAllRecordsWithPeople:allPeople andAddressBook:addressBook];
}else{
//We have to manually compare everyone to see if something has changed.
for (int i=0;i < nPeople;i++) {
ABRecordRef ref = CFArrayGetValueAtIndex(allPeople,i);
ABRecordID refId = ABRecordGetRecordID(ref);
NSNumber *recId = #(refId);
CFDateRef recordCreation = ABRecordCopyValue(ref, kABPersonCreationDateProperty);
NSDate *recCreDate = (__bridge NSDate *)(recordCreation);
NSTimeInterval creDateInterval = [recCreDate timeIntervalSince1970];
if(creDateInterval > lastSyncTime){
//This object was created after my lastSync, this must be a new record
[newRecords addObject:recId];
}else{
//Checking the last update of the given record
CFDateRef recordUpdate = ABRecordCopyValue(ref, kABPersonModificationDateProperty);
NSDate *recUpDate = (__bridge NSDate*)(recordUpdate);
if ([recUpDate timeIntervalSince1970] > lastSyncTime){
//The record was somehow updated since last time, we'll update it
[updatedRecords addObject:recId];
}else{
//The record wasn't updated nor created, it is therefore unchanged.
//We still need to keep it in a separate array to compare deleted contacts
[unchangedRecords addObject:recId];
}
}
}
if(allPeople)
CFRelease(allPeople);
}
[self manageNewContacts:newRecords updatedContacts:updatedRecords andUnchangedContacts:unchangedRecords inAddressBook:addressBook andBlock:^(NSError *error) {
completion(error);
}];
}else{
NSError *error = [NSError errorWithDomain:#"ABAccess access forbidden" code:403 userInfo:nil];
completion(error);
}
}
- (void)manageNewContacts:(NSMutableArray*)newRecords updatedContacts:(NSMutableArray*)updatedRecords andUnchangedContacts:(NSMutableArray*)unchangedRecords inAddressBook:(ABAddressBookRef)addressbook andBlock:(void (^)(NSError *error))completion{
AppDelegate *app = [UIApplication sharedApplication].delegate;
NSManagedObjectContext *context = app.managedObjectContext;
//Getting all the CoreData contacts IDs to have something to compare
NSArray *coreDataContactsIds = [ContactDAO getAllContactIdsInManagedObjectContext:context];
for (NSDictionary *rec in coreDataContactsIds){
NSNumber *recId = rec[#"record_id"];
if (![unchangedRecords containsObject:recId]){
//The unchanged record doesn't exist locally
if (![updatedRecords containsObject:recId]){
//The updated record doesn't exist locally
if (![newRecords containsObject:recId]){
//The new record doesn't exist locally
//That means the ongoing record has been deleted from the addressbook,
//we also have to delete it locally
[ContactDAO deleteContactWithID:recId inManagedObjectContext:context];
}
}
}
}
for (NSNumber *recId in updatedRecords){
ABRecordID recordID = (ABRecordID)recId.intValue;
ABRecordRef person = ABAddressBookGetPersonWithRecordID(addressbook, recordID);
NSDictionary *personDict = [self getPersonDictionaryFromABRecordRef:person];
if (personDict){
[ContactDAO updateContactWithFirstName:personDict[#"firstName"] lastName:personDict[#"lastName"] compositeName:personDict[#"compositeName"] picture:personDict[#"picture"] phoneNumbers:personDict[#"phoneNumbers"] recordID:recId inManagedObjectContext:context];
}
}
for (NSNumber *recId in newRecords){
ABRecordID recordID = (ABRecordID)recId.intValue;
ABRecordRef person = ABAddressBookGetPersonWithRecordID(addressbook, recordID);
NSDictionary *personDict = [self getPersonDictionaryFromABRecordRef:person];
if (personDict){
[ContactDAO createContactWithFirstName:personDict[#"firstName"] lastName:personDict[#"lastName"] compositeName:personDict[#"compositeName"] picture:personDict[#"picture"] phoneNumbers:personDict[#"phoneNumbers"] recordID:recId inManagedObjectContext:context];
}
}
NSError *dbError;
[context save:&dbError];
NSTimeInterval lastSyncTime = [[NSDate date]timeIntervalSince1970];
[[NSUserDefaults standardUserDefaults]setObject:#(lastSyncTime) forKey:#"LastSyncTime"];
completion(dbError);
}
- (NSDictionary*)getPersonDictionaryFromABRecordRef:(ABRecordRef)person{
//Get name
NSString * firstName, *lastName;
firstName = CFBridgingRelease(ABRecordCopyValue(person, kABPersonFirstNameProperty));
lastName = CFBridgingRelease(ABRecordCopyValue(person, kABPersonLastNameProperty));
firstName = (firstName == nil) ? #"" : firstName;
lastName = (lastName == nil) ? #"" : lastName;
NSString *compositeName;
if ([firstName isEqualToString:#""] && [lastName isEqualToString:#""]){
return nil;
}
if ([lastName isEqualToString:#""]){
compositeName = [NSString stringWithFormat:#"%#", firstName];
}
if ([firstName isEqualToString:#""]){
compositeName = [NSString stringWithFormat:#"%#", lastName];
}
if (![lastName isEqualToString:#""] && ![firstName isEqualToString:#""]){
compositeName = [NSString stringWithFormat:#"%# %#", firstName, lastName];
}
//Get picture
CFDataRef imageData = ABPersonCopyImageData(person);
NSData *data = CFBridgingRelease(imageData);
//Get phone numbers
NSMutableSet *phoneNumbers = [[NSMutableSet alloc]init];
ABMultiValueRef phones = ABRecordCopyValue(person, kABPersonPhoneProperty);
for(CFIndex i = 0; i < ABMultiValueGetCount(phones); i++) {
CFStringRef str = ABMultiValueCopyValueAtIndex(phones, i);
NSString *num = CFBridgingRelease(str);
[phoneNumbers addObject:num];
/*if(str)
CFRelease(str);*/
}
//Save it in dictionary
NSDictionary *personDict = [[NSDictionary alloc]initWithObjectsAndKeys:firstName, #"firstName",lastName , #"lastName",phoneNumbers,#"phoneNumbers", compositeName, #"compositeName", data, #"picture", nil];
//Release everything.
if(phones)
CFRelease(phones);
return personDict;
}
When it comes to indexes, this tutorial should do fine.
Have a look to this : http://www.appcoda.com/ios-programming-index-list-uitableview/
Methods of table view help out to give your desired result :
- (NSArray *)sectionIndexTitlesForTableView:(UITableView *)tableView
and
- (NSInteger)tableView:(UITableView *)tableView sectionForSectionIndexTitle:(NSString *)title

Tricky Object Sorting and Removing from NSMutableArray

I have an array of objects (that contain a message), every object has the same structure. It has a message property which is an NSDictionary. One dictionary looks like this:
<message: {
keyCreateDate = "06/08/14 21:23";
keyMessage = Lorem ipsum;
keyReceiverChannel = sampleString;
keySenderUser = SampleName;
},...
My goal is to make an "inbox" where i would like to display the newest messages from every user in each cell. I want the show only the newest messages from each user, like the Fb messages, What'sApp or iMessage inbox, every cell in the table view represents the recent message from a friend. It looks very easy, but it's much harder than i imaged. So i need to remove every message from every friend, but always keep newest one. Actually i can remove all message from one user, but can't keep the newest while removing the others. Is it possible to do this?
I can remove all message for one specified user with this code:
NSMutableArray *originalArray = [[NSMutableArray alloc]initWithArray:message];
NSMutableArray *objectsToRemove = [[NSMutableArray alloc]init];
NSMutableArray *cloneArray = [NSMutableArray arrayWithArray:originalArray];
for (NMessage *messageObject in originalArray) {
if ([messageObject.message[#"keySenderUser"] isEqual:usernameString]) {
[objectsToRemove addObject:messageObject];
}
}
if ([objectsToRemove count]>0) {
[cloneArray removeObjectsInArray:objectsToRemove];
NSLog(#"deleted: %#", objectsToRemove);
self.messagesArray = [[NSMutableArray alloc]initWithArray:cloneArray];
I think it would be the easier, if i could somehow add an exception to the [cloneArray removeObjectsInArray:objectsToRemove]; line, that doesn't let to remove the newest ones. But it's also a problem that i need to sort the messages based on the keySenderUser before i delete them. My actual code can't do that, it can find only one pre-defined user's message and remove all of them. Please share with me if you have any idea. Thanks in advance.
I feel bottom up is better in your case where you build a new array which contains latest message dictionary.
The solution is as below.
1. sort the array using date.
2. Create a new list for holding user messages.
2. Loop through each object check whether the user is already present, If not add it to the created list.
The code solution is below, pass in your array of messaged, which would give a list of messages which are latest for an user.
-(NSArray *) GetLatestMessageListForEveryUser:(NSArray *) array
{
NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
NSArray *sortedArray = [array sortedArrayUsingComparator:^NSComparisonResult(id obj1, id obj2) {
NSDate *obj1Date = [formatter dateFromString: [(NSDictionary *)obj1 objectForKey:#"keyCreateDate" ] ];
NSDate *obj2Date = [formatter dateFromString:[(NSDictionary *)obj2 objectForKey:#"keyCreateDate" ] ];
return ([obj1Date earlierDate:obj2Date] == obj1Date);
}];
NSMutableArray *messageArray = [NSMutableArray array];
NSMutableArray *usersArray = [NSMutableArray array];
for (NSDictionary *messageDictionary in sortedArray)
{
NSString *userName = [messageDictionary objectForKey:#"keySenderUser"];
if (![usersArray containsObject:userName])
{
[usersArray addObject:userName];
[messageArray addObject:messageDictionary];
}
}
return messageArray;
}

iOS NSDictionary Values

I have an array of NSDictionaries and i can access the values in them just fine but i am trying to filter these dictionaries down based on a user's search (user can only search by the dictionary key (#"uniqueSignName").
Once the user has searched through the names property i then need to display ALL dictionary associated data for that #"uniqueSignName" value.
I do the following code and always get the correct amount of NSLogs. For the life of me i cannot remember how to GET those dictionaries.
for (int i = 0; i < [filteredDictionaries count]; i++) {
if ([[[filteredDictionaries valueForKey:#"uniqueSignName"] objectAtIndex:i] isEqualToString:[self.filteredResults objectAtIndex:indexPath.row]]) {
NSLog(#"Power Rangers");
}
}
Eg: I search for "John"
NSLog: #"Power Rangers"
Correctly only appears once.
Now, how do i access another property of "John's" dictionary?
If you want to search the name then better way is that to use NPredicate without iterating the array.
Please see the below example..it may help you...
// Here array is your main array...
NSArray *filteredarray = [array filteredArrayUsingPredicate:[NSPredicate predicateWithFormat:#"(uniqueSignName == %#)", #"John"]];
So the problem is solved, I can now access all the filtered properties.
for (NSDictionary *dict in filteredDictionaries) {
if ([[self.filteredResults objectAtIndex:indexPath.row] isEqualToString: dict[#"uniqueSignName"]]) {
NSString *myString = [NSString stringWithFormat:#"%#", dict[#"pType"]];
NSLog(#"hugh: %#", myString);
myString = displayPtype;
}
}

Resources