Ich hole mir einen JSON-Encodierten Inhalt von einer URL und lege diesen auf einen String.
Ein JSON-Framework verarbeitet diesen und stellt ein NSDictionary zur Verfügung.
Soweit funktioniert alles sehr gut, korrekte Werte & Ausgaben sind vorhanden.
Sobald ich allerdings im UITableView scrolle, stürtzt der iPhone Simulator ab.
Ich bin nun seit 2h auf Fehlersuche & komme leider nicht weiter.
Vielleicht findet ihr etwas..
Alles anzeigen
Alles anzeigen
DANKE!
Ein JSON-Framework verarbeitet diesen und stellt ein NSDictionary zur Verfügung.
Soweit funktioniert alles sehr gut, korrekte Werte & Ausgaben sind vorhanden.
Sobald ich allerdings im UITableView scrolle, stürtzt der iPhone Simulator ab.
Ich bin nun seit 2h auf Fehlersuche & komme leider nicht weiter.
Vielleicht findet ihr etwas..
Quellcode
- /*
- * Kontoauszug.h
- */
- @interface Kontoauszug : UIViewController {
- IBOutlet UILabel *$Kontonummer;
- IBOutlet UILabel *$Kontoinhaber;
- IBOutlet UILabel *$LetzterUmsatz;
- IBOutlet UITableView *kontoUmsaetze;
- NSDictionary *data;
- NSURL *indexUrl;
- NSString *fetchData;
- }
- @property(nonatomic, retain) IBOutlet UILabel *$Kontonummer;
- @property(nonatomic, retain) IBOutlet UILabel *$Kontoinhaber;
- @property(nonatomic, retain) IBOutlet UILabel *$LetzterUmsatz;
- @property(nonatomic, retain) IBOutlet UITableView *kontoUmsaetze;
- @property(nonatomic, retain) NSDictionary *data;
- @property(nonatomic, retain) NSURL *indexUrl;
- @property(nonatomic, retain) NSString *fetchData;
- @end
Quellcode
- /*
- * Kontoauszug.m
- */
- #import "Kontoauszug.h"
- #import "Config.h"
- #import "JSON.h"
- @implementation Kontoauszug
- @synthesize $Kontonummer, $Kontoinhaber, $LetzterUmsatz;
- @synthesize kontoUmsaetze;
- @synthesize data, indexUrl, fetchData;
- - (void)viewDidLoad {
- self.navigationItem.title = @"Kontoauszug";
- Config *sharedManager = [Config Globales];
- indexUrl = [NSURL URLWithString:[NSString stringWithFormat:@"%@/allgemein/kontoauszug.php", [sharedManager APIURL]]];
- fetchData = [NSString stringWithContentsOfURL:indexUrl encoding:NSUTF8StringEncoding error:nil];
- //fetchData = [NSString stringWithString:@"{\"foo\": \"bar\"}"];
- data = [fetchData JSONValue];
- $Kontonummer.text = [data objectForKey:@"Kontonummer"];
- $Kontoinhaber.text = sharedManager.$SESSION_Name;
- $LetzterUmsatz.text = [data objectForKey:@"lastSaldo"];
- [super viewDidLoad];
- }
- - (NSInteger)numberOfSectionsInTableView:(UITableView *)atableView {
- return 1;
- }
- - (NSInteger)tableView:(UITableView *)atableView numberOfRowsInSection:(NSInteger)section {
- return 15;//[[data objectForKey:@"aktivitaeten"] count];
- }
- - (NSString *)tableView:(UITableView *)thetableView titleForHeaderInSection:(NSInteger)section{
- return @"";
- }
- - (UITableViewCell *)tableView:(UITableView *)atableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
- static NSString *CellIdentifier = @"Cell";
- UITableViewCell *cell = [kontoUmsaetze dequeueReusableCellWithIdentifier:CellIdentifier];
- if (cell == nil) {
- cell = [[[UITableViewCell alloc] initWithFrame:CGRectZero] autorelease];
- }
- UILabel *umsatzTitle = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 200, 20)];
- umsatzTitle.backgroundColor = [UIColor redColor];
- umsatzTitle.font = [UIFont fontWithName:@"Arial" size:10];
- umsatzTitle.text = [NSString stringWithFormat:@"%@", [data objectForKey:@"Kontonummer"]];//[[[data objectForKey:@"aktivitaeten"] objectForKey:action4T] objectForKey:@"action"];
- [cell.contentView addSubview:umsatzTitle];
- [umsatzTitle release];
- return cell;
- }
- - (CGFloat)tableView:(UITableView *)atableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
- {
- return 20;
- }
- - (NSIndexPath *)tableView :(UITableView *)theTableView willSelectRowAtIndexPath:(NSIndexPath *)indexPath {
- return nil;
- }
- - (void)didReceiveMemoryWarning {
- [super didReceiveMemoryWarning];
- }
- - (void)dealloc {
- [$Kontonummer release];
- [$Kontoinhaber release];
- [$LetzterUmsatz release];
- [kontoUmsaetze release];
- [data release];
- [indexUrl release];
- [fetchData release];
- [super dealloc];
- }
- @end
DANKE!