Zum Inhalt springen
View in the app

A better way to browse. Learn more.

Fachinformatiker.de

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Empfohlene Antworten

Veröffentlicht

Mooooin.... kurze knappe Frage.. Objective C.

Wie kann ich diese if Schleife kurz fassen? Array? Dictionary?

:

if ([wert hasSuffix:@"a"] || [wert hasSuffix:@"b"] ||[wert hasSuffix:@"c"] ||[wert hasSuffix:@"d"] ||[wert hasSuffix:@"e"] ||[wert hasSuffix:@"f"] ||[wert hasSuffix:@"g"] ||[wert hasSuffix:@"h"] ||[wert hasSuffix:@"i"] ||[wert hasSuffix:@"j"] ||[wert hasSuffix:@"k"] ||[wert hasSuffix:@"l"] ||[wert hasSuffix:@"m"] ||[wert hasSuffix:@"n"] || [wert hasSuffix:@"o"] || [wert hasSuffix:@"p"] ||[wert hasSuffix:@"q"] ||[wert hasSuffix:@"r"] ||[wert hasSuffix:@"s"] ||[wert hasSuffix:@"t"] ||[wert hasSuffix:@"u"] ||[wert hasSuffix:@"v"] ||[wert hasSuffix:@"w"] ||[wert hasSuffix:@"x"] ||[wert hasSuffix:@"y"] ||[wert hasSuffix:@"z"] || [wert hasSuffix:@"<"] ||[wert hasSuffix:@">"] ||[wert hasSuffix:@"!"] ||[wert hasSuffix:@"?"] ||[wert hasSuffix:@"^"])

{

[self.output setStringValue:@"Fehlerhaftes Zeichen!"];

}

mfg Lewis...

1. Du definierst dir eine Collection für alle erlaubten Zeichen und prüfst, ob diese Collection dein Zeichen beinhaltet.

2. Du schreibst 100 mal an die Tafel "Ich sage nie wieder If-Schleife"

2. Hab ich mich falsch ausgedrückt? :D
Eine if-Anweisung leitet eine Verzweigung ein, keine Schleife. Schleife bedeutet in der Programmierung eine Wiederholung, bei if wird nichts wiederholt. Daher ist der Begriff "If-Schleife" in sich widersprüchlich.
  • Autor

Okay dann hab ich ja jetzt wieder etwas Neues dazu gelernt ;-)

Trotzdem weiß ich immer noch nicht, was ich jetzt genau machen kann... Array und die einzelnen Strings einfügen ? oder wie ?

Erstelle ein Konto oder melde dich an, um einen Kommentar zu schreiben.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.