Jump to content
Sign in to follow this  
LooN3y

Whats Wrong With My Code? (Presenting Modal View)

5 posts in this topic

Recommended Posts

I'm trying to have a modal view controller that i call programmatically.

 

 

heres my code:

 

 

 

- (IBAction)searchView:(id)sender
{
   GlobalStrings* theDataObject = [self theGlobalClass];

   if (theDataObject.presentSearch == nil)
   {   
    UIStoryboard *storyboard = [uIStoryboard storyboardWithName:@"MainStoryboard" bundle:nil];
    UIViewController *vc = [storyboard instantiateViewControllerWithIdentifier:@"SearchBarViewController"];
    [vc setModalPresentationStyle:UIModalPresentationFullScreen];

    [self presentModalViewController:vc animated:YES];
   }

   UIStoryboard *storyboard = [uIStoryboard storyboardWithName:@"MainStoryboard" bundle:nil];
   UIViewController *vc = [storyboard instantiateViewControllerWithIdentifier:@"SearchBarViewController"];
   [vc setModalPresentationStyle:UIModalPresentationFullScreen];
}

 

 

i get a sigbart error, is it because the view controller I'm calling is a navigation controller?

 

 

i also have a similar method in my "ViewWillAppear" for my log in screen.

Share this post


Link to post
Share on other sites
Advertisement

Is the view controller you're trying to call before the navigation controller a navigation controller as well? You could also segue to another storyboard by programatically setting up a segue to another view controller.

Share this post


Link to post
Share on other sites

Is the view controller you're trying to call before the navigation controller a navigation controller as well? You could also segue to another storyboard by programatically setting up a segue to another view controller.

 

 

 

no the login screen isn't a navigation controller.

 

segue to another story board?

Share this post


Link to post
Share on other sites

Xcode might be iffy if you try to push a navigation controller on top of one that isn't already. Not to another storyboard just within that storyboard segue from that view controller to your navigation controller would be what I would do. You want me to elaborate a bit more on that or do you understand how to segue programatically?

Share this post


Link to post
Share on other sites

Xcode might be iffy if you try to push a navigation controller on top of one that isn't already. Not to another storyboard just within that storyboard segue from that view controller to your navigation controller would be what I would do. You want me to elaborate a bit more on that or do you understand how to segue programatically?

 

 

hmm for now, i just modally called the search view controller by button, just to get over the hump, i just want it to work first and foremost.

 

 

thanks a lot though

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By ITzTravelInTime
      Hi guys, this thread is to show you a new and open source app, created by me, that I called TINU:
       
      The name means: TINU Is Not #####, the U refers to a popular software that is used to create Mac OS hackintosh installers (that for good reasons is banned on this forum), but the aim of the name is to explain that this app is a totally different thing from that software and works in a totally different way.
       
      This app basically is a graphical interface for the createinstallmedia executable that is inside the Mac OS installer apps, it is capable to create a Mac OS installer on a drive completely vanilla like what you do using the command line method, and also this method is recommended by apple itself.
       
      Allows you to create easily a macOS install media without messing around with command line stuff and without using disk utility, all you need to do is use the app and then install clover on the usb drive once TINU has finished or leave it as is you want to use it on a Mac.
       
      Features:
        - Simple to use UI that allows you to easily start the macOS install media creation process   - It can work with every Mac OS installer app that has the createinstallmedia executable inside of it's resources folder (including also beta and newly released installers)   - You can use any drive or partition you want that can be erased and is at least 7 GB of size   - Works on Mac OS recovery, so you can create a macOS install media from a bootable macOS installer or from the macOs recovery   - All vanilla, the macOS install medias created with this tool are 100% vanilla, just like you created them using the command line "createinstallmedia" method   - Open source, you will know what this program does on your computer and also you can create your own version by downloading and playing with the source code   - Does not requires to do anything of special first, just open the program   - No need to go in disk utility first, TINU can format your drive for you   - Uses recent and more modern APIs and SDKs and Swift 3 language   - Transparent graphics style available (use alt + s on the keyboard or View->Use transparent style)   - Works using the latest versions of macOS and will also support newer Mac installers out of the box without needing for an update    Features that I'd like to add in the future:    - Advanced section, to customize your macOS install media   - Installer customization: Kernelcache/prelinkedknerel and boot files replacement (a feature that can be handy while dealing with old Macs or with beta installers when you need to mod or change the boot files some times)   - Install clover and configure clover   - Install kexts inside the kexts folder of clover   - Clover drivers customization   - Use custom dsdt in clover   - integrated pre-made clover config templates database from a remote and open repository   - Support for other languages, at least Italian   Rquirements:  - A computer that runs Mac OS X Yosemite or a more recent version (Mac OS X El Capitan is required to use TINU in a macOS recovery or installer)  - A drive or a free partition of at least 7 GB that you want to turn into a macOS/Mac OS X installer  - A copy of a macOS/Mac OS X installer app (Maveriks or newer versions are supported) in the /Applications folder or in the root of any storage drive in your machine (excepted the drive or volume you want to turn into your macOS install media)   Note that this app is under the GNU GPL v3 license so any reuse of the source code must follow the license's terms   TINU 1.1 Stable release:    - Download available here:    https://github.com/ITzTravelInTime/TINU/releases    - Source code:     https://github.com/ITzTravelInTime/TINU   TINU 2.0 pre-release:    - Source code:    https://github.com/ITzTravelInTime/TINU/tree/development    - Download available here:    https://dl.dropboxusercontent.com/s/nvzss51qcieynve/TINU.zip     Frequently asked questions about TINU: https://github.com/ITzTravelInTime/TINU/wiki/FAQs     NOTE: if you have problems with your USB installer of 10.13.4 or newer version not being detected by clover you have to use the latest clover and if it still does not detectets your usb installer you have to remove the invivible file called .IAPhysicalMedia located into the root of the usb installer. This issue is caused by a changement in the apple's createinstallmedia, don't blame TINU for that, tinu does only uses the installer creation method from apple, which has been changed, causing this problem for hackintosh users, this issue should be resolved in the latest versions of clover which will no longer require that you do changements to let your usb dive to be detected, a setting to do this fix automatically in tinu is also comeing in a new pre-release of TINU 2 I leave also some screenshots as well








    • By Allan
      We are very close to WWDC 18, so the expeculations are very high. Look at this graphics:

      One of the big expectations for macOS is be a cross-platform system, to help developers bring their iOS apps to the Mac platform.
      Let's see...

      View full article
    • By Allan
      We are very close to WWDC 18, so the expeculations are very high. Look at this graphics:

      One of the big expectations for macOS is be a cross-platform system, to help developers bring their iOS apps to the Mac platform.
      Let's see...
    • By DahenECE
      Hello guys! 
      I’m fresher at MacOS!
      while i came to mac and Hackintosh I become interested into making app development for MacOs and also IOS!
      for me making app for IOS is something clear! And already developed some bacis apps!
      but i now i love to learn about making gui app for mac!
      i’m at Basic!
      i hope someone help me to show the correct way or path to follow and start learning and making app for mac!
      i know at first nothing is easy especially GUI app!
      but right  now i have no idea about it
      so i hope someone help me to show me what programming language can be used to make gui app for mac?, what ide should i use? 
      Note: i have already studied and learned 
      cpp,c,c#,assembly,matlab,basic pythoN,basic swift....
      just need a guide how to start and where to start!
      i know it depends on what i want to make!
      but everything have some basic idea! So I would love to someone show me the path!
      thank you so much!!!!!
    • By ITzTravelInTime
      Questo è il thread in italiano dedicato alla mia app TINU, l'app open source che ho creato per creare chiavetta di installazione di mac utilizzando il metodo "createinstallmedia".
      Il nome è l'acronimo di TINU Is Not U (Per le regole del forum devo censurare, ma la U si riferisce ad un programma che piu o meno svolge lo stesso scopo che che per buoni motivi è bandito su questo sito, il punto del metterlo nel nome sta nel sottolineare che la mia app è totalmente divera)
      L'app è pensata per essere molto semplice ed immediata da usare (con un interfaccia grafica progettata con criteri e metodi usati in ambito professionale per lo sviluppo di applicazioni utente) e per essere molto solida e stabile che funziona sempre al primo colpo (a differenza di altri tool che conosciamo ...)
      A livello funzionale quest'app non è altro che un interfaccia grafica per il metodo da terminale "createinstallmedia" che viene sfrutatto dalla stessa per creare la chiavetta, quindi le chiavette create con TINU sono chiavette al 100% vanilla come se le aveste create dal terminale, a questo l' applicazione aggiunge funzioni utili come la formattazione automatica della chiavetta USB che si sceglie di usare in formato Mac OS Extended (journaled) (detto anche HFS+) con mapatura di partizione GUID.
      Tra gli altri vantaggi troviamo il fatto che permette di creare chiavette utilizzando qualunque applicazione di mac che contiene l'eseguibile "createinstallmedia" inclusi installer delle beta ed installer appena rilasciati, e non richiede di fare cose particolari prima come formattare la chiavetta e cambiare lingua al sistema e puo utilizzare applicazioni di mac che si trovano in vaie directory nel sistema e non solo quelle sche stanno in applicazioni ed hanno un nome specifico (nota che l'applicazione di installazione di mac deve essere quella interacche pesa diversi gb e non quella da pochi mb che l'app store puo scaricare alcune volte e che contiene tutto quello che serve per permettere a createinstallmedia di funzionare)
      l'applicazione è completamente aprta ed open source e trovate qui alcuni link utili:
       - Scarica l'app: https://github.com/ITzTravelInTime/TINU/releases
       - Repo github di TINU: https://github.com/ITzTravelInTime/TINU
       - FAQs (in inglese): https://github.com/ITzTravelInTime/TINU/wiki/FAQs
       - Thread in inglese su tinu (English thread about TINU): http://www.insanelymac.com/forum/topic/326959-tinu-the-macos-install-media-creation-tool-mac-app/
      Qui invece ci sono un paio di guide (Anche se l'app è molto facile da usare):
       - Piccola guida su come usare TINU per un hackintosh: https://www.youtube.com/watch?v=fZOZOUt2ErM
       - Piccola guida su come usare TINU per creare cheiavette per Mac "originali": https://www.youtube.com/watch?v=fZOZOUt2ErM
      Attualemente è in fase di sviluppo una nuova versione di questa app che verrà rilasciata a breve e che include diverse novità e migliorie importanti.
      Per chi se lo chiede, il supporto a clover in TINU è pianificato per una versione futura, anche se dei protipi a livvello codice per renderlo possibile, sono gia stati sperimentati con successo.
       
      Spero che anche voi del forum italiano aprezzerete questa app come gli utenti del forum inglese, per idee e suggerimenti, siete liberi di esprimervi :-)

×