iOS讀取plist文件

百度搜到的太多廢話,我這直接上代碼

    NSString *plistPath = [[NSBundle mainBundle] pathForResource:@"address" ofType:@"plist"];
    //當數據結構爲數組時
    NSArray *array = [[NSArray alloc] initWithContentsOfFile:plistPath];
    //當數據結構爲非數組時
    NSDictionary *dictionary = [[NSDictionary alloc] initWithContentsOfFile:plistPath];
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章