Ho molta confusione riguardo all'API di Clang Format.Come configurare Clang Format per lo stile Allman per la codifica iOS?
- Non riesco ad aprire il file .clangformat in modo che possa dare un'occhiata a questo e configurare secondo me.
- Ho bisogno di formattare il mio codice in stile Allman.
- Ho visto molta documentazione su Google e Stack Overflow, ma non ho avuto alcun aiuto per ottenere la formattazione stile Allman.
mi sono imbattuto http://clangformat.com/ ma anche non ho avuto alcun aiuto per raggiungere stile Allman.
Ecco il problema e la soluzione che voglio.
Issue # 1:
[[NSNotificationCenter defaultCenter]
addObserver:self
selector:@selector(captureSearchFiltersNotificationWithSelection:)
name:kSearchFiltersNotificationWithSelection
object:nil];
BISOGNO # 1:
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(captureSearchFiltersNotificationWithSelection:)name:kSearchFiltersNotificationWithSelection object:nil];
Issue # 2:
- (id)initWithNibName:(NSString *)nibNameOrNil
bundle:(NSBundle *)nibBundleOrNil {
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
if (self) {
// listings = [NSMutableArray new];
self.navTitle = @"Buy";
searchFilters = [SearchFilter new];
if ([LocationManager locationManager].location == nil) {
selectedSortOption = kSortBuyRefineOptionUndefined;
}
else {
selectedSortOption = kSortBuyRefineOptionNearMeAsc;
}
}
return self;
}
BISOGNO # 2:
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle*)nibBundleOrNil
{
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
if (self)
{
listings = [NSMutableArray new];
self.navTitle = @"Buy";
searchFilters = [SearchFilter new];
if ([LocationManager locationManager].location == nil)
{
selectedSortOption = kSortBuyRefineOptionUndefined;
}
else
{
selectedSortOption = kSortBuyRefineOptionNearMeAsc;
}
}
return self;
}
@halfer Qualche idea sulla risposta? – Developer
Ri: "Non riesco ad aprire il file .clangformat in modo che possa dare un'occhiata a questo e configurarlo secondo me.", Potresti chiarire cosa intendi, poiché non è chiaro? Il nome del file dovrebbe normalmente essere '.clang-format' o' _clang-format' e inserito nella directory del progetto. –
@ l 'l In quale editor, posso vedere il contenuto del file ".clang-format"? – Developer