Posts

ios - objective-c - Attach UIImage to share -

i have issues following code. thing want image attached share message. nsstring *texttoshare = @"i'm feeling good!"; nsurl *mywebsite = [nsurl urlwithstring:@"http://www.iamgross.de"]; uiimage *bestimage = [uiimage imagenamed:@"besticon"]; nsarray *objectstoshare = @[bestimage, texttoshare, mywebsite]; dispatch_async(dispatch_get_global_queue(dispatch_queue_priority_default, 0), ^{ //here non-main thread. uiactivityviewcontroller *activityvc = [[uiactivityviewcontroller alloc] initwithactivityitems:objectstoshare applicationactivities:nil]; nsarray *excludeactivities = @[uiactivitytypeairdrop, uiactivitytypeprint, uiactivitytypeassigntocontact, uiactivitytypesavetocameraroll, uiactivitytypeaddtoreadinglist, uiactivitytypeposttofl...

ios - Where to look in Xcode for debug information -

i’m new ios, xcode development… , i’m having trouble trying figure why app failing @ specific point. i have starting viewcontroller called mainmenuviewcontroller has label application title , 2 buttons. each button acts segue action show 2 more viewcontrollers. the app builds when mainmenuviewcontroller appears if click on first button takes me next viewcontroller , actions on , subsequent viewcontrollers lead on these views segue actions take me mainmenuviewcontroller of these views work correctly. from mainmenuviewcontroller if click second button segue action fails , xcode points class appdelegate: uiresponder, uiapplicationdelegate { line in file appdelegate.swift. where should looking find out why app failed? ok... figured out... 2 views had commonality when completed first view copied common controls on other view. unknown me not transferred control had sentevent referenced first view controller. these not replaced new references constructed added to. deleti...

javascript - Edit multiple html files - add string to <head> -

i have huge static html site , need add new script , css path @ end of each head section. there tool can me in ?. or maybe can use php or js? i'm quite new in this. thank help. you use notepad++ add code every file. open notepad++, open search -> replace (or ctrl + h ) go 'find in files' tab find </head> replace with: <script src="script.js"></script> <link rel="stylesheet" rel="style.css"> </head> http://www.makeuseof.com/tag/how-to-find-and-replace-words-in-multiple-files/ you can use php includes. have html file script , css in, example: <script src="script.js"></script> <link rel="stylesheet" rel="style.css"> put html code want on every page, in 1 file , call it, say, include.html then use php code in file want code: <?php include('include.html'); ?>

html - CSS - White space around top and left of page -

i'm building web app , unfortunately have white border around top , left of page. have set html , body padding , margin 0px doesn't seem having effect on it. inside of body single iframe , when preview site , go on inspect element shows padding on body... here code - if take great! <html> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <meta http-equiv="x-ua-compatible" content="chrome=1,ie=edge" /> <title>index</title> <style> html { height:100%; } body { background-color: #ffffff; margin: 0px !important; padding: 0px !important; height:100%; } </style> <!-- copy these lines document head: --> <meta name="viewport" content="user-scalable=yes, width=320" /> <!-- end copy --> </head...

angularjs - How to make dropbox items unselectable? -

i have html element: <select class="form-control" ng-model="current.data.sites" ng-options="item.id item.description item in current.lookups.sitereg | filterbyidarray: current.data.sites"> <option value="">--data--</option> when open dropbox want items displayed want make unselectable. any idea how can make items in dropbox unselectable? you need set disabled on option tag. if want make options disabled have use ng-repeat rather ng-options. <select class="form-control" > <option value="">--data--</option> <option ng-repeat="item in current.lookups.sitereg | filterbyidarray: current.data.sites" value="{{item}}">{{item}}</option> </select>

symfony - Symfony2 / Form - Change GET Method generated URL -

i have form method, , action have 3 optional parameters. if submit form, form generate url this: "example.com/keyword=test?category=test1?country=test2" but route looks "example.com/{keyword}/{category}/{country}" how can solve issue? i tried this: if($form->isvalid()){ return $this->redirect($this->generateurl('route', array('keyword' => $form['keyword']->getdata(), ... ))); } but can't because render form in ::base.html.twig, , redirection doesn't work ... searchformaction: public function searchformaction(request $request) { $form = $this->createform(new searchtype(),null, array('action' => $this->generateurl('web_portal_search'))); $form->handlerequest($request); if($form->isvalid()){ // return $this->redirecttoroute('web_portal_search', // array( // 'keyword' => $form[...

python - Unclear behavior of multithreading application: can't exit thread -

multithreading app on python 2.7. use "threading" , "thread" libraries. main thread had started other 10 threads, work. have 1 shared class data (singletone). don't use thread blocking, , it's seems good. main thread starting threads "start" , "join" methods of threading class. 1 of ten threads, starting every 10 seconds , math calculation. when work complete, thread invoke "thread.exit()". and main thread did not have result of 1 thread. thread end! , strings of code complete, main thread stops on "join" instruction , did not response. p.s. i'm not native english speacker, , discribe problem difficult. please tolerant. code example: while true: all_result = check_is_all_results() time.sleep(1) if (all_result): print app_data.task_table app_data.flag_of_close = true time.sleep(2) # Задержка на всякий случай if (app_data.flag_of_close): terminate() print u"test" if len...