Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 982645
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T04:43:51+00:00 2026-05-16T04:43:51+00:00

i am trying to return a list of users whose accounts have expired from

  • 0

i am trying to return a list of users whose accounts have expired from my server to my iphone objective c app using CFPropertyLIst but the data returned in the NSURLConnection callback is always null. I think my use of CFPropertyList may not be correct but can’t work out why not

$query="SELECT user, UNIX_TIMESTAMP(created) AS created_ts FROM  accounts"
$result = mysql_query($query)  


$userarray = new CFArray ();
while($row = mysql_fetch_array($result))
{
    $user = $row['user'];
    $created_ts = $row['created_ts'];

   $entry = new CFDictionary();
   $entry->add('user', new CString($user));
   $entry->add('created_ts', new CFNumber($created_ts));
   $userarray->add($entry);

}

$plist = new CFPropertyList();
$plist->add($userarray);
$plist->toXML();
var_dump($plist);

Objective C

- (void)connectionDidFinishLoading:(NSURLConnection *)connection {
    // We have got everything so no longer need the connection so release it.
    [theConnection release];
    theConnection = nil;

NSString *errorString = nil;
NSArray *array = [[NSPropertyListSerialization 
                       propertyListFromData:theData
                       mutabilityOption:NSPropertyListImmutable
                       format:nil
                       errorDescription:&errorString] retain];

}

Here I’m always getting unexpected character o at line 1
because the format of the plist looks like this which appears ok but still always getting this error

object(CFPropertyList)#5 (17)
{
[“file:protected”]=> NULL
[“format:protected”]=> int(0)
[“value:protected”]=> array(1) {
[0]=> object(CFArray)#1 (2)
{
[“iteratorPosition:protected”]=>
int(0)
[“value:protected”]=>
array(1) {
[0]=> object(CFDictionary)#2 (3)
{
[“iteratorPosition:protected”]=> int(0)
[“iteratorKeys:protected”]=> NULL
[“value:protected”]=> array(2)
{
[“user”]=> object(CFString)#3 (1) {
[“value:protected”]=>
string(9) “anonymous”
}
[“created_ts”]=>
object(CFNumber)#4 (1) {
[“value:protected”]=>
int(1281263044)
}
}
}
}
}
}
[“iteratorPosition:protected”]=> int(0)
[“iteratorKeys:protected”]=> NULL
[“content:protected”]=> NULL
[“pos:protected”]=> int(0)
[“uniqueTable:protected”]=>
array(0) {
}
[“countObjects:protected”]=> int(0)
[“stringSize:protected”]=> int(0)
[“intSize:protected”]=> int(0)
[“miscSize:protected”]=> int(0)
[“objectRefs:protected”]=> int(0)
[“writtenObjectCount:protected”]=>int(0)
[“objectTable:protected”]=>
array(0) {
}
[“objectRefSize:protected”]=>int(0)
[“offsets:protected”]=>
array(0) {
}
}

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T04:43:52+00:00Added an answer on May 16, 2026 at 4:43 am

    Your output there is not a plist; it’s the internal representation of a CFPropertyList. Have a look at http://developer.apple.com/mac/library/documentation/Darwin/Reference/ManPages/man5/plist.5.html for a short sample plist.

    Your problem is that $plist->toXML() does not modify $plist; it returns a string of the XML representation of the $plist object. Change:

    $plist->toXML();
    var_dump($plist);
    

    to

    $xml = $plist->toXML();
    var_dump($xml);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to get a list of users from the Active Directory, who have
I'm trying to return a list of course id's from my database with PDO
I am trying to return a list of object from my mapper and save
I am trying to return all MSFT Lync Users who have used voice conferencing
I am trying to use OData4J to retrieve a list of Users from the
I'm currently trying to write a query that will return all users that have
Basically I am trying to return a list of names gotten from an Ajax
I am trying to display a list of users in a custom webpart using
Im trying to return a SimpleQuery list that queries a single table and uses
I'm trying to return the most common elements in a list (statistical mode). Unfortunately

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.