Skip to content

Commit 048ed72

Browse files
author
Björn
committed
Fixed: The HMProductFound notification was posted in the for-loop instead of after the for-loop
1 parent aba6dc5 commit 048ed72

File tree

3 files changed

+12
-2
lines changed

3 files changed

+12
-2
lines changed

HitmeisterAPI.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,9 @@ + (void) executeRequetsWithURL:(NSURL*)requestUrl {
3737
@catch (NSException *exception) {
3838
NSLog(@"Catched exception %@", exception);
3939
}
40-
41-
[[NSNotificationCenter defaultCenter] postNotificationName:@"HMProductFound" object:nil userInfo:[NSDictionary dictionaryWithObject:product forKey:@"product"]];
4240
}
41+
42+
[[NSNotificationCenter defaultCenter] postNotificationName:@"HMProductFound" object:nil userInfo:[NSDictionary dictionaryWithObject:product forKey:@"product"]];
4343
}
4444
weakRequest = nil;
4545
}];

Product.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,4 +40,6 @@
4040

4141
@property (nonatomic, strong) NSString *commission_category;
4242

43+
- (NSString*) getCheapestPriceFormatted;
44+
4345
@end

Product.m

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,12 @@ @implementation Product
2323
@synthesize listprice_savings;
2424
@synthesize commission_category;
2525

26+
- (NSString*) getCheapestPriceFormatted
27+
{
28+
NSNumberFormatter *formatter = [[NSNumberFormatter alloc] init];
29+
[formatter setNumberStyle:NSNumberFormatterCurrencyStyle];
30+
[formatter setLocale:[[NSLocale alloc] initWithLocaleIdentifier:@"de_DE"]];
31+
return [formatter stringFromNumber:[NSNumber numberWithInt:self.cheapest_price]];
32+
}
33+
2634
@end

0 commit comments

Comments
 (0)