companion
Read/Write From Plist of iPhone
We can only get permission to write plist,if it is written in the document directory, on the run time the simulator also get accessible the document directory.So before writing to plist first we need to fetch the path of documents directory.
Step 1:Get the path of document directory.
-(NSString *)pathofFile {
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *docsfolder = [paths objectAtIndex:0];
return [docsfolder stringByAppendingFormat:@"data.plist"];
}
Above method returns the path of document directory append with a "data.plist" file, it is our target plist file.
Step 2:Write to plist
NSMutableDictionary *dict = [[NSMutableDictionary alloc] init];
[dict setValue:@"100" forKey:@"mark"];
NSString *filepath = [self pathofFile];
[dict writeToFile:[self pathofFile] atomically:YES];
The above code write the value "100" to the key "mark" of data.plist file
Step 3:Read from Plist:
NSMutableDictionary *pListDict = nil;
NSString *filepath = [self pathofFile];
pListDict = [[NSMutableDictionary alloc]initWithContentsOfFile:filepath];
NSString *str = [pListDict valueForKey:@"mark"];
NSLog(str);
It print "100"
Hope it helps Some one.
Regards,
Companion.
IPL 2: Another success story?
The Indian Premier League's second season came to a close on Sunday with the Deccan Chargers claiming the crown. But what about IPL as a concept? How have advertisers embraced it? Is it a success?
The verdict is out and IPL has validated itself, both as a concept and as a platform for advertisers to reach out to the masses.
IPL boss Lalit Modi has, in fact, increased his 10-year revenue forecast by 17 per cent to a huge Rs 10,800 crore and he could be right.
Shashi Sinha, CEO of Lodestar, said, “Despite IPL going to elections or elections issue, the fact is, we now have a core set of viewers and loyalty concept is slowly coming in.
Even a lower rating of 5.5 is the highest on TV now. So, IPL has become a big media property and the good thing is, it looks sustainable.”
Meanwhile, Sony as well as franchisees also did well with air revenues around Rs 500 crore and another Rs 200 crore from on ground advertising.
That's almost double of season 1 advertising sales, which were Rs 400 crore all inclusive.
Even FMCG companies jumped onto the IPL bandwagon with HUL and Godrej spending crores as co-sponsors and Sony feels that other sectors can chip in, too, for the next season.
Rohit Gupta, president of sales at Sony Entertainment, said,
“Hopefully, for the third season financial and real estate sector would have been revived. Even retail sector will see improvements. So, this will add to the segment and we will be able to achieve our target.
However, in terms of television ratings, IPL2 did take a hit. Although IPL's share of the television universe came down primarily due to the Lok Sabha elections, it did manage to attract a larger audience of 7.4 million viewers per game on average.
Last year, before the IPL kicked off, the question on everyone's minds was whether or not the IPL would succeed as a concept and as an advertising platform.
Now, after the conclusion of the league's second season, the question is not about the success of the IPL, but how big of a success will it be?